X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdebug%2Fprofiler.cpp;h=af1380000639c9698ae333046654b11026929495;hb=9f2774a500d779af9a38f42bfb03b507444a47b0;hp=4251797a974bb33e676b288120c03a57f97f0d1b;hpb=e7638f74d3e4869020a19dfa1cc700d52373f01c;p=libs%2Fcore.git 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;