|
nmsg 1.1.2
|
Sleeping and getting the current time. More...
Go to the source code of this file.
Functions | |
| void | nmsg_timespec_get (struct timespec *ts) |
| Get the current time. | |
| void | nmsg_timespec_sleep (const struct timespec *ts) |
| Sleep. | |
| void | nmsg_timespec_add (const struct timespec *a, struct timespec *b) |
| Add timespecs a and b, placing result in b. | |
| void | nmsg_timespec_sub (const struct timespec *a, struct timespec *b) |
| Subtract timespec a from b, placing result in b. | |
| double | nmsg_timespec_to_double (const struct timespec *ts) |
| Convert timespec to floating point representation. | |
| void | nmsg_timespec_from_double (double seconds, struct timespec *ts) |
| Convert floating point number of seconds to timespec. | |
Sleeping and getting the current time.
Definition in file timespec.h.
| void nmsg_timespec_get | ( | struct timespec * | ts | ) |
Get the current time.
If available, clock_gettime() will be used to attempt to get the current real time. If unavailable, gettimeofday() will be used and scaled up to nanosecond precision.
| [out] | ts | current time. |
| void nmsg_timespec_sleep | ( | const struct timespec * | ts | ) |
Sleep.
nanosleep() will be called, and reinvoked if interrupted.
| [in] | ts | duration to sleep. |
| void nmsg_timespec_add | ( | const struct timespec * | a, |
| struct timespec * | b | ||
| ) |
Add timespecs a and b, placing result in b.
(b = b + a).
| [in] | a | |
| [in,out] | b |
| void nmsg_timespec_sub | ( | const struct timespec * | a, |
| struct timespec * | b | ||
| ) |
Subtract timespec a from b, placing result in b.
(b = b - a).
| [in] | a | |
| [in,out] | b |
| double nmsg_timespec_to_double | ( | const struct timespec * | ts | ) |
Convert timespec to floating point representation.
| [in] | ts |
| void nmsg_timespec_from_double | ( | double | seconds, |
| struct timespec * | ts | ||
| ) |
Convert floating point number of seconds to timespec.
| [in] | seconds | Floating point number of seconds. |
| [out] | ts |