GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
* Sign Up! *

Support
Customer Portal
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
TIME(9) FreeBSD Kernel Developer's Manual TIME(9)

boottime, time_second, time_uptimesystem time variables

#include <sys/time.h>


extern struct timeval boottime;
extern time_t time_second;
extern time_t time_uptime;

The boottime variable holds the estimated system boot time. This time is initially set when the system boots, either from the RTC, or from a time estimated from the system's root filesystem. When the current system time is set, stepped by ntpd(8), or a new time is read from the RTC as the system resumes, boottime is recomputed as new_time - uptime. The sysctl(8) kern.boottime returns this value.

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. It is adjusted when the phase of the system time changes.

clock_settime(2), ntp_adjtime(2), settimeofday(2), bintime(9), binuptime(9), getbintime(9), getbinuptime(9), getmicrotime(9), getmicrouptime(9), getnanotime(9), getnanouptime(9), microtime(9), microuptime(9), nanotime(9), nanouptime(9)

Poul-Henning Kamp, “Timecounters: Efficient and precise timekeeping in SMP kernels”, Proceedings of EuroBSDCon 2002, Amsterdam, /usr/share/doc/papers/timecounter.ascii.gz.

Marshall Kirk McKusick and George V. Neville-Neil, The Design and Implementation of the FreeBSD Operating System, Addison-Wesley, 57-61,65-66, July 2004.

May 4, 2021 FreeBSD 15.1-RELEASE-p1

Search for    or go to Top of page |  Section 9 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.