28 #ifndef SPLA_TIME_PROFILER_HPP
29 #define SPLA_TIME_PROFILER_HPP
62 std::chrono::steady_clock::time_point
start;
63 std::chrono::steady_clock::time_point
end;
73 void dump(std::ostream& where);
77 std::map<std::string, TimeProfilerLabel*> m_labels;
85 #define TIME_PROFILE_LABEL __auto_profile_label
86 #define TIME_PROFILE_SUBLABEL __auto_profile_sublabel
88 #define TIME_PROFILE_SUBSCOPE(name) \
89 static TimeProfilerLabel TIME_PROFILE_SUBLABEL(&__auto_profile_label, name, __FILE__, __FUNCTION__); \
90 TimeProfilerScope __auto_profile_subscope(&TIME_PROFILE_SUBLABEL);
92 #define TIME_PROFILE_SCOPE(name) \
93 static TimeProfilerLabel TIME_PROFILE_LABEL(nullptr, name, __FILE__, __FUNCTION__); \
94 TimeProfilerScope __auto_profile_scope(&TIME_PROFILE_LABEL);
96 #define TIME_PROFILE_LABEL
97 #define TIME_PROFILE_SUBLABEL
98 #define TIME_PROFILE_SCOPE(name)
99 #define TIME_PROFILE_SUBSCOPE(name)
Scope-based time profiler to measure perf of schedule tasks execution.
Definition: time_profiler.hpp:70
void reset()
Definition: time_profiler.cpp:79
void add_label(TimeProfilerLabel *label)
Definition: time_profiler.cpp:59
void dump(std::ostream &where)
Definition: time_profiler.cpp:63
Definition: algorithm.hpp:37
Definition: time_profiler.hpp:44
TimeProfilerLabel * parent
Definition: time_profiler.hpp:54
int child_count
Definition: time_profiler.hpp:50
std::uint64_t executed_nano
Definition: time_profiler.hpp:53
std::atomic_uint64_t nano
Definition: time_profiler.hpp:51
std::string name
Definition: time_profiler.hpp:47
TimeProfilerLabel(TimeProfilerLabel *in_parent, const char *in_name, const char *in_file, const char *in_function)
Definition: time_profiler.cpp:34
std::uint64_t queued_nano
Definition: time_profiler.hpp:52
const char * file
Definition: time_profiler.hpp:48
Definition: time_profiler.hpp:57
std::chrono::steady_clock::time_point start
Definition: time_profiler.hpp:62
TimeProfilerScope(TimeProfilerLabel *in_label)
Definition: time_profiler.cpp:48
std::chrono::steady_clock::time_point end
Definition: time_profiler.hpp:63
TimeProfilerLabel * label
Definition: time_profiler.hpp:61
~TimeProfilerScope()
Definition: time_profiler.cpp:53