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

CPU timer. More...

#include <imstkTimer.h>

Inheritance diagram for imstk::CpuTimer:
Inheritance graph
[legend]
Collaboration diagram for imstk::CpuTimer:
Collaboration graph
[legend]

Public Member Functions

 CpuTimer ()
 Constructor.
 
 ~CpuTimer ()=default
 Destructor.
 
virtual void start () override
 Start the appropriate timer.
 
double getTimeElapsed (const TimeUnitType unitType=TimeUnitType::milliSeconds) override
 Returns the CPU time elapsed since calling start NOTE: This measurement is not entirely accurate especially if one tries to measure CPU time used by certain calls in a multi-threaded application.
 
- Public Member Functions inherited from imstk::StopWatch
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.
 
void printTimeElapsed (std::string const &name=std::string("noName"), const TimeUnitType unitType=TimeUnitType::milliSeconds)
 Print the elapsed time.
 

Static Public Attributes

static const double cpuTimerConstants [4]
 
- Static Public Attributes inherited from imstk::StopWatch
static const double wcTimerConstants [4]
 

Additional Inherited Members

- Public Types inherited from imstk::StopWatch
enum  TimerState { started, stopped }
 
enum  TimeUnitType { milliSeconds, seconds, minutes, hours }
 
- Static Public Member Functions inherited from imstk::StopWatch
static std::string getTimeAndDate ()
 Returns a string with current date and time in UTC.
 

Detailed Description

CPU timer.

Definition at line 97 of file imstkTimer.h.

Member Data Documentation

◆ cpuTimerConstants

const double imstk::CpuTimer::cpuTimerConstants
static
Initial value:
= {
1000.0 / CLOCKS_PER_SEC,
1.0 / CLOCKS_PER_SEC,
1.0 / (CLOCKS_PER_SEC * 60.0),
1.0 / (CLOCKS_PER_SEC * 60.0 * 60.0)
}

Definition at line 100 of file imstkTimer.h.


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