X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdebug%2Fprofiler.h;h=5018c7f2d654100b7a0de87901d1c0708f114eeb;hb=9b38e20254913629a0db40e8eb8e1c42e1728e41;hp=7a82c5631899699cb42d04773bbf6e4c9ec5b4e9;hpb=df062ebec635daeb68e6f8ce46f8aa7c0b913164;p=libs%2Fcore.git diff --git a/source/debug/profiler.h b/source/debug/profiler.h index 7a82c56..5018c7f 100644 --- a/source/debug/profiler.h +++ b/source/debug/profiler.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -24,7 +25,7 @@ profiled. Note: This is not thread-safe. To profile multiple threads, create a separate Profiler for each thread. */ -class Profiler +class Profiler: private NonCopyable { public: struct CallInfo @@ -36,27 +37,23 @@ public: struct ScopeInfo { Time::TimeStamp first_call; - unsigned calls; + unsigned calls = 0; Time::TimeDelta total_time; Time::TimeDelta self_time; Time::TimeDelta avg_time; - float calls_per_sec; + float calls_per_sec = 0; std::vector history; - unsigned hist_pos; - bool hist_full; + unsigned hist_pos = 0; + bool hist_full = false; std::map called_from; - - ScopeInfo(); }; private: - unsigned period; + unsigned period = 0; std::map scopes; - ProfilingScope *inner; + ProfilingScope *inner = 0; public: - Profiler(); - /** Sets the averaging period for timing data, measured in calls. Previous average timings are cleared. */ void set_period(unsigned p);