MICROTIME(9)
π MICROTIME(9) π
okay so welcome to the Kernel Developer's Manual, bestie β this is the MICROTIME(9) page, and it's literally all about getting the current time. π°οΈβ¨
β¨ NAME β¨
bintime, getbintime, microtime, getmicrotime, nanotime, getnanotime β get the current time. That's the whole assignment, no cap. π
πΈ SYNOPSIS πΈ
First up, the include and the signatures β keep these exact, bestie:
#include <sys/time.h>
void
bintime(struct bintime *bt);
void
getbintime(struct bintime *bt);
void
microtime(struct timeval *tv);
void
getmicrotime(struct timeval *tv);
void
nanotime(struct timespec *ts);
void
getnanotime(struct timespec *tsp);
π DESCRIPTION π
okay so here's the tea, function by function:
bintime()andgetbintime()store the system time as astruct bintimeat the addresses specified bybt. π«Άmicrotime()andgetmicrotime()perform the same utility, but record the time as astruct timevalinstead. β±οΈ- similarly,
nanotime()andgetnanotime()store the time as astruct timespec. π§
Then there's the precision-vs-speed vibe check:
bintime(),microtime(), andnanotime()always query the timecounter to return the current time as precisely as possible. They are the main characters of accuracy. πgetbintime(),getmicrotime(), andgetnanotime()are abstractions which return a less precise, but faster to obtain, time. Lowkey the speedrun squad. π₯
The intent of getbintime(), getmicrotime(), and getnanotime() is to enforce the user's preference for timer accuracy versus execution time. It's giving "you choose the vibe: precise or quick." βοΈβ¨
π¦ SEE ALSO π¦
binuptime(9)getbinuptime(9)getmicrouptime(9)getnanouptime(9)microuptime(9)nanouptime(9)tvtohz(9)
π HISTORY π
The bintime functions first appeared in FreeBSD 5.0. The microtime and nanotime functions first appeared in FreeBSD 3.0 but have existed in other incarnations since 4.4BSD. History really said "we've been doing this since forever." ππ
π AUTHORS π
This manual page was written by Kelly Yancey <kbyanc@posi.net>. Iconic behavior. π«Ά
π Cute little sign-off: this page's source/version is Debian, it's dated September 16, 2004, and the manual name is MICROTIME(9). Byeeee π β¨
π¦ where this page comes from
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 2000 Kelly Yancey
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms