X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fdebug%2Fprofiler.h;h=7a82c5631899699cb42d04773bbf6e4c9ec5b4e9;hp=ad0653c0697f566b31f356974733293277d6e63b;hb=df062ebec635daeb68e6f8ce46f8aa7c0b913164;hpb=4798e6e5eac917b6225a1295fa5b118d88345237 diff --git a/source/debug/profiler.h b/source/debug/profiler.h index ad0653c..7a82c56 100644 --- a/source/debug/profiler.h +++ b/source/debug/profiler.h @@ -18,7 +18,8 @@ external profilers, but allows profiling of custom scopes and retrieving the profiling data at run time. An example usage could be showing realtime performance statistics of a game or a simulation. -See also class ProfilingScope. +Data can be recorded by creating a ProfilingScope object in the scope to be +profiled. Note: This is not thread-safe. To profile multiple threads, create a separate Profiler for each thread. @@ -56,32 +57,24 @@ private: public: Profiler(); - /** - Sets the averaging period for timing data, measured in calls. Previous - average timings are cleared. - */ + /** Sets the averaging period for timing data, measured in calls. Previous + average timings are cleared. */ void set_period(unsigned p); - /** - Adds a scope without recording any calls to it. Useful if you might need to - access a scope before it has finished for the first time. - */ + /** Adds a scope without recording any calls to it. Useful if you might + need to access a scope before it has finished for the first time. */ void add_scope(const std::string &name); - /** - Changes the recorded innermost scope pointer and returns the old one. This - is used by ProfilingScope to track child time and should not be called - manually. - */ + /** Changes the recorded innermost scope pointer and returns the old one. + This is used by ProfilingScope to track child time and should not be called + manually. */ ProfilingScope *enter(ProfilingScope *ps); /** Records the data from a ProfilingScope. It is not useful to call this manually. */ void record(const ProfilingScope &); - /** - Returns informations about a scope. - */ + /** Returns informations about a scope. */ const ScopeInfo &get_scope(const std::string &) const; };