Simbody
3.6
|
Modules | |
High-Resolution Elapsed Time Measurement and Sleep | |
Measuring CPU Time | |
Timespec/Nanosecond/Second Conversions | |
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).