iMSTK
Interactive Medical Simulation Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
imstk::StopWatch Class Reference

Stop Watch utility class. More...

#include <imstkTimer.h>

Inheritance diagram for imstk::StopWatch:
Inheritance graph
[legend]

Public Types

enum  TimerState { started, stopped }
 
enum  TimeUnitType { milliSeconds, seconds, minutes, hours }
 

Public Member Functions

virtual void start ()
 Start the appropriate timer.
 
virtual void stop ()
 Start the appropriate timer.
 
void storeLap (std::string const &lapName)
 Start the appropriate timer.
 
void storeLap ()
 
void printLapTimes ()
 Print all the lap times.
 
virtual void reset ()
 Clears all the laps.
 
double getTotalLapTimes ()
 Returns the total time from all.
 
virtual double getTimeElapsed (const TimeUnitType unitType=TimeUnitType::milliSeconds)
 Returns the time elapsed since calling start.
 
void printTimeElapsed (std::string const &name=std::string("noName"), const TimeUnitType unitType=TimeUnitType::milliSeconds)
 Print the elapsed time.
 

Static Public Member Functions

static std::string getTimeAndDate ()
 Returns a string with current date and time in UTC.
 

Static Public Attributes

static const double wcTimerConstants [4]
 

Detailed Description

Stop Watch utility class.

Definition at line 19 of file imstkTimer.h.

Member Data Documentation

◆ wcTimerConstants

const double imstk::StopWatch::wcTimerConstants
static
Initial value:
= {
1.0,
1 / 1000.0,
1 / (1000.0 * 60.0),
1 / (1000.0 * 60.0 * 60)
}

Definition at line 22 of file imstkTimer.h.


The documentation for this class was generated from the following files: