From: Mikko Rasa Date: Fri, 28 Dec 2007 20:47:02 +0000 (+0000) Subject: Fix an integer rounding error in Profiler X-Git-Tag: 1.0~10 X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=cac699732d60d05edc73c39075b85f45a91a620a;p=libs%2Fcore.git Fix an integer rounding error in Profiler --- 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;