X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fdebug%2Fprofilingscope.cpp;h=723529c9a4b7ccaa259fc14d6ce4696bac3cc472;hp=bf3363de2fdce5d42d8f0e78655d35b3febea5c8;hb=817e584903996a041692640720a5a272d847a3c7;hpb=fc1475d88018934a61df890c192a404a105308fd diff --git a/source/debug/profilingscope.cpp b/source/debug/profilingscope.cpp index bf3363d..723529c 100644 --- a/source/debug/profilingscope.cpp +++ b/source/debug/profilingscope.cpp @@ -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); }