X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fdebug%2Fprofiler.cpp;h=af1380000639c9698ae333046654b11026929495;hp=4251797a974bb33e676b288120c03a57f97f0d1b;hb=cac699732d60d05edc73c39075b85f45a91a620a;hpb=e7638f74d3e4869020a19dfa1cc700d52373f01c diff --git a/source/debug/profiler.cpp b/source/debug/profiler.cpp index 4251797..af13800 100644 --- a/source/debug/profiler.cpp +++ b/source/debug/profiler.cpp @@ -68,7 +68,7 @@ void Profiler::record(const string &scope_name, const string &parent, const Time si.self_time+=time-child_t; if(period) { - si.avg_time+=(time-si.history[si.hist_pos])/period; + si.avg_time+=time/period-si.history[si.hist_pos]/period; si.history[si.hist_pos++]=time; if(si.hist_pos>=period) si.hist_pos-=period;