Get the current time
#include <sys/time.h> int gettimeofday( struct timeval * when, void * not_used );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The gettimeofday() function returns the current time in when in seconds and microseconds, since the Unix Epoch, 00:00:00 January 1, 1970 Coordinated Universal Time (UTC) (formerly known as Greenwich Mean Time (GMT)).
0 for success, or -1 if an error occurs (errno is set).
POSIX 1003.1 OB XSI. This function is marked as obsolescent, and may be removed from a future version of the standard.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |
The gettimeofday() function is provided for porting existing code. You shouldn't use it in new code; use clock_gettime() instead.