X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fdebug%2Fprofilingscope.cpp;h=723529c9a4b7ccaa259fc14d6ce4696bac3cc472;hp=62f6340d801aca9f7583369f8953128e8ee9ab60;hb=292aed8e23ea543b089d5f2a73000de4640befe7;hpb=967785734be5c3fc6f75da122c2d93ebbb338271 diff --git a/source/debug/profilingscope.cpp b/source/debug/profilingscope.cpp index 62f6340..723529c 100644 --- a/source/debug/profilingscope.cpp +++ b/source/debug/profilingscope.cpp @@ -1,4 +1,4 @@ -#include "../time/utils.h" +#include #include "profilingscope.h" using namespace std; @@ -10,19 +10,15 @@ ProfilingScope::ProfilingScope(Profiler &p, const string &n): profiler(p), name(n), parent(profiler.enter(this)), - start_t(Time::now()) + entry_time(Time::now()) { } ProfilingScope::~ProfilingScope() { - const Time::TimeDelta dt = Time::now()-start_t; + time_spent = Time::now()-entry_time; if(parent) - { - parent->child_t += dt; - profiler.record(name, parent->name, dt, child_t); - } - else - profiler.record(name, string(), dt, child_t); + parent->child_time += get_time_spent(); + profiler.record(*this); profiler.enter(parent); }