1 #ifndef MSP_DEBUG_PROFILINGSCOPE_H_
2 #define MSP_DEBUG_PROFILINGSCOPE_H_
4 #include <msp/time/timestamp.h>
11 RAII timing class to accompany Profiler. Timing starts when an object is
12 created and ends when it goes out of scope. If there was another object in an
13 outer scope, it is notified of the time used in inner scopes.
20 ProfilingScope *parent;
21 Time::TimeStamp entry_time;
22 Time::TimeDelta time_spent;
23 Time::TimeDelta child_time;
25 ProfilingScope(const ProfilingScope &);
26 ProfilingScope &operator=(const ProfilingScope &);
28 ProfilingScope(Profiler &p, const std::string &n);
31 const std::string &get_name() const { return name; }
32 const ProfilingScope *get_parent() const { return parent; }
33 const Time::TimeStamp &get_entry_time() const { return entry_time; }
34 const Time::TimeDelta &get_time_spent() const { return time_spent; }
35 const Time::TimeDelta &get_child_time() const { return child_time; }