-#include "../time/utils.h"
+#include <msp/time/utils.h>
#include "profilingscope.h"
using namespace std;
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);
}