From cac699732d60d05edc73c39075b85f45a91a620a Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 28 Dec 2007 20:47:02 +0000 Subject: [PATCH] Fix an integer rounding error in Profiler --- source/debug/profiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.43.0