Main index | Section 9 | 日本語 | Options |
#include <sys/time.h>
extern struct timeval boottime;
extern time_t time_second;
extern time_t time_uptime;
The time_second variable is the system's "wall time" clock to the second.
The time_uptime variable is the number of seconds since boot.
The bintime(9), getbintime(9), microtime(9), getmicrotime(9), nanotime(9), and getnanotime(9) functions can be used to get the current time more accurately and in an atomic manner. Similarly, the binuptime(9), getbinuptime(9), microuptime(9), getmicrouptime(9), nanouptime(9), and getnanouptime(9) functions can be used to get the time elapse since boot more accurately and in an atomic manner. The boottime variable may be read and written without special precautions.
Proceedings of EuroBSDCon 2002, Amsterdam, /usr/share/doc/papers/timecounter.ascii.gz, Timecounters: Efficient and precise timekeeping in SMP kernels,
,The Design and Implementation of the FreeBSD Operating System, 57-61,65-66, Addison-Wesley, July 2004.
, ,TIME (9) | September 17, 2004 |
Main index | Section 9 | 日本語 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | Today, the Unix equivalent of a power drill would have 20 dials and switches, come with a nonstandard plug, require the user to hand-wind the motor coil, and not accept 3/8" or 7/8" drill bits (though this would be documented in the BUGS section of its instruction manual). | ” |
— The Unix Haters' handbook |