Simbody  3.6
Timing.h File Reference

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.

Namespaces

 SimTK
 This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with other symbols.
 

Macros

#define SimTK_IS_APPLE_AND_MUST_DECLARE_CLOCK_GETTIME   0
 
#define SimTK_IS_APPLE_AND_MUST_DEFINE_CLOCK_GETTIME   0
 

Functions

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). More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
long long SimTK::realTimeInNs ()
 Return current time on the high-resolution interval timer in nanoseconds, as a 64-bit integer count. More...
 
double SimTK::realTime ()
 Return current time on the high-resolution interval timer in seconds. More...
 
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. More...
 
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. More...
 

Detailed Description

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.

Macro Definition Documentation

◆ 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