Class ExecutionTimer

Class Documentation

class ExecutionTimer

Measures execution time of code between calls to start and end.

Public Types

using Clock = std::chrono::high_resolution_clock
using nanoseconds = std::chrono::nanoseconds

Public Functions

inline void start()

Call just prior to code you want to measure.

inline void end()

Call just after the code you want to measure.

inline nanoseconds elapsed_time()

Extract the measured time as an integral std::chrono::duration object.

inline double elapsed_time_in_seconds()

Extract the measured time as a floating point number of seconds.

Protected Attributes

Clock::time_point start_
Clock::time_point end_