101 const std::string& className,
102 const std::string& operationName,
103 bool plotResultInDestructor,
104 bool startToTickImmediately =
true
A simple class that has to be included to measure the clock ticks required for an operation.
tarch::logging::Log _log
Log device the result is written to.
Watch(const std::string &className, const std::string &operationName, bool plotResultInDestructor, bool startToTickImmediately=true)
Construct a watch.
double getCalendarTime()
This method returns the elapsed calendar time between the start and stop command of the timer,...
std::clock_t getCPUTicks()
Equals getCPUTime() but returns the clock ticks instead of the time in seconds.
bool _isRunning
Has stopTimer() been called before.
double getCPUTime()
Return CPU Time in Seconds.
bool _plotResultInDestructor
Flag to distinguish the (original) standard watch.
bool isOn() const
This operation returns whether the watch is currently on.
void start()
(Re)Start the Timer
virtual ~Watch()
For standard version (): Stops the watch and plots the time spent.
double _elapsedTime
Holds the elapsed calendar time.
std::clock_t _elapsedClockTicks
Holds the elapsed processor time.
std::chrono::steady_clock::time_point _startTime
Holds the time at the beginning of the time measurement.
std::clock_t _startClockTicks
Holds the clock ticks at the beginning of the time measurement.
std::string _operationName
Stores the name of the operation the watch is used within.