23 #define timespec timeval
55 double diff(timespec
start, timespec end);
void printSplits()
Prints the Timer's splits to the console.
Definition: Timer.cpp:176
double _elapsed_time
Definition: Timer.h:41
double diff(timespec start, timespec end)
Helper function which computes the time between the values of two timespec structs.
Definition: Timer.cpp:134
double getTime()
Returns the amount of time elapsed from start to stop of the timer.
Definition: Timer.cpp:99
void reset()
Resets the timer in a similar fashion to resetting a stopwatch.
Definition: Timer.cpp:60
virtual ~Timer()
Default Timer destructor.
Definition: Timer.cpp:18
timespec _end_time
Definition: Timer.h:39
timespec _start_time
Definition: Timer.h:37
Timer()
Timer class constructor.
Definition: Timer.cpp:9
void start()
Starts the Timer in a similar fashion to starting a stopwatch.
Definition: Timer.cpp:24
std::vector< std::pair< double, const char * > > _timer_splits
Definition: Timer.h:45
void recordSplit(const char *msg)
Records a message corresponding to a given time recorded by the timer.
Definition: Timer.cpp:87
void restart()
Restarts the timer.
Definition: Timer.cpp:72
The Timer represents a simulation stopwatch.
Definition: Timer.h:34
Utility functions for writing log messages to the screen.
void stop()
Stops the timer in a similar fashion to stopping a stopwatch.
Definition: Timer.cpp:42
bool _running
Definition: Timer.h:43