seconds, ticks, fastticks, HZ, MS2HZ, MS2TK, TK2MS, TK2SEC – kernel times and time conversions
vlong fastticks(uvlong *hz)
#define HZ ...
#define MS2HZ (1000/HZ)
#define TK2SEC(t) ((t)/HZ)
#define TK2MS(t) ((t)*(1000/HZ))
returns the system’s idea of the current time as the number of seconds
since the start of the epoch
(00:00:00 GMT, January 1, 1970).
field of the
structure returns the number of system-dependent clock ticks on the
given processor since system boot.
On a multiprocessor,
is sometimes used to provide a reference time, since the tick value
might vary slightly across processors.
returns the number of ticks since boot as measured by the
fastest clock provided by the platform.
The frequency of the clock, in ticks per second,
is returned through
unless it is nil.
The system clock frequencies are platform-dependent.
Several symbolic constants and macro functions are defined by
to convert between different time units:
The number of clock ticks per second.
Milliseconds per clock tick.
clock ticks to seconds (truncating not rounding).
clock ticks to milliseconds.