Linux Assemblycollection of fast libraries

Time system calls

The kernel measures the passage of time in three different ways: wall time (or real time), process time and monotonic time. These three measurements of time may be represented in one of two formats: relative time and absolute time. Managing the passage of time on a Linux system involves several tasks, only some of which any given process is concerned with: they include setting and retrieving the current wall time, calculating elapsed time, sleeping for a given amount of time, performing high-precision measurements of time, and controlling timers. This is accessible via Linux time system calls.

Contents

Tip: For detailed information about each system call please read: Linux man pages

Current time of day

SyscallNumberDescription
TIME201Get time in seconds
SETTIMEOFDAY164Set time
GETTIMEOFDAY96Get time

POSIX clocks

SyscallNumberDescription
CLOCK_SETTIME227Set the time of the specified clock
CLOCK_GETTIME228Get the time of the specified clock
CLOCK_GETRES229Get resolution of the specified clock
CLOCK_ADJTIME305Tune the specified clock
CLOCK_NANOSLEEP230Do high-resolution sleep using the specified clock

Clocks-based timers

SyscallNumberDescription
TIMER_CREATE222Create a POSIX per-process timer
TIMER_DELETE226Delete a POSIX per-process timer
TIMER_SETTIME223Arm/disarm POSIX per-process timer
TIMER_GETTIME224Fetch state of POSIX per-process timer
TIMER_GETOVERRUN225Get overrun count for a POSIX per-process timer

Timers

SyscallNumberDescription
ALARM37Set an alarm clock for delivery of a signal
SETITIMER38Set value of an interval timer
GETITIMER36Get value of an interval timer

File descriptor based timers

SyscallNumberDescription
TIMERFD_CREATE283Creates a new file descriptors based timer object
TIMERFD_SETTIME286Arm/disarm the timer referred to by the file descriptor
TIMERFD_GETTIME287Get current setting of the timer referred to by the file descriptor

Miscellaneous

SyscallNumberDescription
ADJTIMEX159Tune kernel clock
NANOSLEEP35High-resolution sleep
TIMES100Get process times
Copyright 2012-2018 Jack Black. All rights reserved.