This file ensures that we have access to the Posix time functions clock_getttime() and nanosleep(), and also provides some convenient methods for use in common timing situations.
More...
Go to the source code of this file.
|
namespace | SimTK |
| This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with other symbols.
|
|
|
long long | SimTK::timespecToNs (const timespec &ts) |
| Convert a time stored in a timespec struct to the equivalent number of nanoseconds (as a signed quantity).
|
|
void | SimTK::nsToTimespec (const long long &ns, timespec &ts) |
| Given a signed number of nanoseconds, convert that into seconds and leftover nanoseconds in a timespec struct.
|
|
double | SimTK::nsToSec (const long long &ns) |
| Given a count of nanosecond ticks as a signed 64 bit integer, return the same time interval as a double precision floating point number of seconds.
|
|
long long | SimTK::secToNs (const double &s) |
| Given a signed time interval as a double precision floating point number of seconds, return the same time interval as a count of nanosecond ticks in a signed 64 bit integer.
|
|
double | SimTK::cpuTime () |
| Return the cumulative CPU time in seconds (both kernel and user time) that has been used so far by any of the threads in the currently executing process.
|
|
double | SimTK::threadCpuTime () |
| Return the total CPU time in seconds (both kernel and user time) that has been used so far by the currently executing thread.
|
|
long long | SimTK::realTimeInNs () |
| Return current time on the high-resolution interval timer in nanoseconds, as a 64-bit integer count.
|
|
double | SimTK::realTime () |
| Return current time on the high-resolution interval timer in seconds.
|
|
void | SimTK::sleepInNs (const long long &ns) |
| Sleep for the indicated number of nanoseconds, with the actual precision system dependent but intended to be the best achievable, hopefully less than 5ms in all cases.
|
|
void | SimTK::sleepInSec (const double &seconds) |
| Sleep for the indicated number of seconds, with the actual precision system dependent but intended to be the best achievable, hopefully less than 5ms in all cases.
|
|
This file ensures that we have access to the Posix time functions clock_getttime() and nanosleep(), and also provides some convenient methods for use in common timing situations.
◆ SimTK_IS_APPLE_AND_MUST_DECLARE_CLOCK_GETTIME
#define SimTK_IS_APPLE_AND_MUST_DECLARE_CLOCK_GETTIME 0 |
◆ SimTK_IS_APPLE_AND_MUST_DEFINE_CLOCK_GETTIME
#define SimTK_IS_APPLE_AND_MUST_DEFINE_CLOCK_GETTIME 0 |