API
4.3
For C++ developers
|
Record and report elapsed real time ("clock" or "wall" time) in seconds. More...
Public Member Functions | |
Stopwatch () | |
This stores the start time as the current time. More... | |
void | reset () |
Reset the start time to the current time. More... | |
double | getElapsedTime () const |
Return the amount of time that has elapsed since this object was constructed or since reset() has been called. More... | |
long long | getElapsedTimeInNs () const |
Get elapsed time in nanoseconds. More... | |
std::string | getElapsedTimeFormatted () const |
This provides the elapsed time as a formatted string (using format()). More... | |
Static Public Member Functions | |
static std::string | formatNs (const long long &nanoseconds) |
Format the provided elapsed time in nanoseconds into a string. More... | |
Record and report elapsed real time ("clock" or "wall" time) in seconds.
|
inline |
This stores the start time as the current time.
References reset().
|
inlinestatic |
Format the provided elapsed time in nanoseconds into a string.
The time may be converted into seconds, milliseconds, or microseconds. Additionally, if the time is greater or equal to 60 seconds, the time in hours and/or minutes is also added to the string. Usually, you can call getElapsedTimeFormatted() instead of calling this function directly. If you call this function directly, use getElapsedTimeInNs() to get a time in nanoseconds (rather than getElapsedTime()).
Referenced by getElapsedTimeFormatted().
|
inline |
Return the amount of time that has elapsed since this object was constructed or since reset() has been called.
|
inline |
This provides the elapsed time as a formatted string (using format()).
References formatNs(), and getElapsedTimeInNs().
|
inline |
Get elapsed time in nanoseconds.
See SimTK::realTimeInNs() for more information.
Referenced by getElapsedTimeFormatted().
|
inline |
Reset the start time to the current time.
Referenced by Stopwatch().