TIME(9)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’– TIME(9) β€” Kernel Developer's Manual πŸ’–

okay bestie, this is the Kernel Developer's Manual page for the system time variables β€” boottime, time_second, and time_uptime. It's giving timekeeping main character energy, and we're keeping every detail, no cap. 🫢


✨ NAME ✨

boottime, time_second, time_uptime β€” system time variables

🌸 SYNOPSIS 🌸

#include <sys/time.h>

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

πŸ¦‹ DESCRIPTION πŸ¦‹

First up, the icon herself: boottime. This variable holds the estimated system boot time. It's 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. slay. πŸ’…

The way that time_second is the system's β€œwall time” clock to the second? Iconic. ⭐

And time_uptime is the number of seconds since boot. πŸ•°οΈ

Now for the accuracy girlies: 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. πŸ”₯

And yes: the boottime variable may be read and written without special precautions. It is adjusted when the phase of the system time changes. πŸ¦‹

πŸŽ€ SEE ALSO πŸŽ€


that's the whole manual page, bestie πŸ’… source/version: Debian, date: May 4, 2021, manual: TIME(9) β€” periodt. 🫢

πŸ“¦ where this page comes from