*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->FreeBSD man pages -> mono_time (9)              
Title
Content
Arch
Section
 

TIME(9)

Contents


NAME    [Toc]    [Back]

     boottime, mono_time, runtime, time -- system time variables

SYNOPSIS    [Toc]    [Back]

     extern struct timeval boottime;
     extern volatile struct timeval mono_time;
     extern struct timeval runtime;
     extern struct timeval time;

DESCRIPTION    [Toc]    [Back]

     The time variable is the system's ``wall time'' clock.  It is set at boot
     by inittodr(9), and is updated by the settimeofday(2) system call and by
     periodic clock interrupts.

     The boottime variable holds the system boot time.	It is set from time at
     system boot, and is updated when the system time is adjusted with
     settimeofday(2).

     The runtime variable holds the time that the system switched to the current
 process.  It is set after each context switch, and is updated when
     the system time is adjusted with settimeofday(2).	Because runtime is
     used for system accounting, it is set with the high-resolution
     microtime(9) function, rather than being copied from time.

     The mono_time variable is a monotonically increasing system clock.  It is
     set from time at boot, and is updated by the periodic timer interrupt.
     (It is not updated by settimeofday(2).)

     All of these variables contain times expressed in seconds and microseconds
 since midnight (0 hour), January 1, 1970.

     Clock interrupts should be blocked when reading or writing time or
     mono_time, because those variables are updated by hardclock().  The
     gettime(9) function can be used to read the time variable in an atomic
     manner.  There is no equivalent function for accessing mono_time.	The
     boottime and runtime variables may be read and written without special
     precautions.

     It should be noted that due to the differences in how the time values
     returned by gettime(9) and microtime(9) are updated, comparing the
     results of the two routines may result in a time value that appears to go
     backwards.  This can be avoided by consistently using one function or the
     other for use in any given context.

SEE ALSO    [Toc]    [Back]

      
      
     settimeofday(2), gettime(9), inittodr(9), microtime(9)

BUGS    [Toc]    [Back]

     The notion of having a single runtime variable obviously would not be
     appropriate in multiprocessor systems.


FreeBSD 5.2.1			March 22, 1997			 FreeBSD 5.2.1
[ Back ]
 Similar pages
Name OS Title
ntptime FreeBSD read kernel time variables
CPU_IS_PA_R HP-UX get configurable system variables
sysconf NetBSD get configurable system variables
sysconf FreeBSD get configurable system variables
sysconf Tru64 Get configurable system variables
sysconf HP-UX get configurable system variables
sysconf OpenBSD get configurable system variables
sysconf IRIX get configurable system variables
sysconf IRIX get configurable system variables (POSIX)
sysctl.conf OpenBSD sysctl variables to set at system startup
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service