Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/t/timer_gettime.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/t/timer_gettime.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/t/timer_gettime.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/t/timer_gettime.html on line 8

timer_gettime()

Get the amount of time left on a timer

Synopsis:

#include <time.h>

int timer_gettime( timer_t timerid,
                   struct itimerspec *value );

Arguments:

timerid
A timer_t object that holds a timer ID, as set by timer_create().
value
A pointer to a itimerspec structure that the function fills in with the timer's time until expiry. The structure contains at least the following members:
struct timespec it_value
A timespec structure that contains the amount of time left before the timer expires, or zero if the timer is disarmed. This value is expressed as the relative interval until expiration, even if the timer was armed with an absolute time.
struct timespec it_interval
A timespec structure that contains the timer's reload value. If nonzero, it indicates a repetitive timer period.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The timer_gettime() function gets the amount of time left before the specified timer is to expire, along with the timer's reload value, and stores it in the space provided by the value argument.

Returns:

0
Success.
-1
An error occurred (errno is set).

Errors:

EINVAL
The timer timerid isn't attached to the calling process.

Classification:

POSIX 1003.1 TMR

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

clock_getres(), clock_gettime(), clock_settime(), nanosleep(), sleep(), timer_create(), timer_delete(), timer_getexpstatus(), timer_getoverrun(), timer_settime(), timespec

Clocks, Timers, and Getting a Kick Every So Often chapter of Getting Started with QNX Neutrino

Tick, Tock: Understanding the Neutrino Microkernel's Concept of Time chapter of the QNX Neutrino Programmer's Guide


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/t/timer_gettime.html on line 178

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/t/timer_gettime.html on line 178