Simbody  3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages

These functions provide a convenient way to do high-precision timing, either for real time use or performance measurement, and to sleep for precise time intervals. More...

Modules

 High-Resolution Elapsed Time Measurement and Sleep
 These functions provide access to the system's high resolution interval timer, and highest precision sleep facility for unscheduling a thread until it is needed at a specific later time.
 
 Measuring CPU Time
 These functions provide measurement of CPU time consumed by a process or by individual threads.
 
 Timespec/Nanosecond/Second Conversions
 These inline functions provide a fast and convenient way for doing arithmetic with the ugly Posix timespec struct.
 

Detailed Description

These functions provide a convenient way to do high-precision timing, either for real time use or performance measurement, and to sleep for precise time intervals.

Both elapsed and CPU timing is supported, with the latter on a per-process or per-thread basis. Times are measured using a double precision floating point number of seconds, which is usually the most convenient form. Alternatives are available that measure time as a 64 bit integer count of nanosecond ticks, providing the highest resolution and consistency for very short measurements.

Note that you can also use the Posix functions clock_gettime() and nanosleep() on any SimTK-supported platform, as well as usleep() (time in microseconds) although Posix considers that obsolete.

On Linux systems, use of these timing functions requires linking with the librt realtime library (-lrt).