34 TimePoint current_time = chr::system_clock::now();
55 snippet_clock = current_time;
57 chr::duration<float> measured_duration = current_time - snippet_clock;
58 snippet_duration += measured_duration;
62 chr::duration<float> print_duration = current_time - print_clock;
63 if (print_duration.count() > 1.0f) {
64 call_count = call_count == 0u ? 1 : call_count;
65 std::cout <<
"Snippet name : " << snippet_name <<
", "
66 <<
"avg. duration : " << 1000 * snippet_duration.count() / call_count <<
" ms, "
67 <<
"total duration : " << snippet_duration.count() <<
" s, "
68 <<
"total calls : " << call_count <<
", "
71 snippet_duration = 0s;
74 print_clock = current_time;