GNU/Linux | 
					CentOS 4.8 | 
					i386 | 
![]()  | 
					clock_gettime(2) | 
					![]()  | 
				
clock_gettime − Return the current timespec value of tp for the specified clock
| 
 long sys_clock_gettime (clockid_t which_clock, struct timespec *tp);  | 
clock_gettime
returns the current timespec value of tp for the
specific clock, which_clock. The values that
clockid_t currently supports for POSIX.1b timers, as
defined in include/linux/time.h, are: 
CLOCK_REALTIME
Systemwide realtime clock.
CLOCK_MONOTONIC
Represents monotonic time. Cannot be set.
CLOCK_PROCESS_CPUTIME_ID
High resolution per-process timer.
CLOCK_THREAD_CPUTIME_ID
Thread-specific timer.
CLOCK_REALTIME_HR
High resolution version of CLOCK_REALTIME.
CLOCK_MONOTONIC_HR
High resolution version of CLOCK_MONOTONIC.
clock_gettime returns 0 on success; otherwise, it returns one of the errors listed in the "Errors" section.
-EINVAL
An invalid which_clock value was specified.
-EFAULT
Can not coy to tp value.
clock_getres(2), clock_nanosleep(2), clock_settime(2)
Niki Rahimi
![]()  | 
				clock_gettime(2) | ![]()  |