| OpenSim Moco
    0.3.0
    | 
Record and report elapsed real time ("clock" or "wall" time) in seconds.
#include <Moco/Moco/MocoUtilities.h>
| Public Member Functions | |
| Stopwatch () | |
| This stores the start time as the current time. | |
| void | reset () | 
| Reset the start time to the current time. | |
| 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()). | |
| Static Public Member Functions | |
| static std::string | formatNs (const long long &nanoseconds) | 
| Format the provided elapsed time in nanoseconds into a string.  More... | |
| 
 | 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()).
| 
 | inline | 
Return the amount of time that has elapsed since this object was constructed or since reset() has been called.
| 
 | inline | 
Get elapsed time in nanoseconds.
See SimTK::realTimeInNs() for more information.