BINTIME_ADD(9)

πŸ“¦ version 11.0, in nixpkgs unstable

🌸 NAME 🌸

bintime_add β€” operations on β€œbintime” πŸ’–

okay so bestie, this is the Kernel Developer's Manual page for BINTIME_ADD(9), and it's literally all about the β€œbintime” operations. no cap. ✨


✨ SYNOPSIS ✨

#include <sys/time.h>

vid
bintime_add(struct bintime *bt, const struct bintime *bt2);

void
bintime_addx(struct bintime *bt, uint64_t x);

void
bintime_sub(struct bintime *bt, const struct bintime *bt2);

void
bintime2timespec(const struct bintime *bt, struct timespec *ts);

void
timespec2bintime(const struct timespec *ts, struct bintime *bt);

void
bintime2timeval(const struct bintime *bt, struct timeval *tv);

void
timeval2bintime(const struct timeval *tv, struct bintime *bt);

yup, that's the exact squad right there β€” keep those declarations exactly as written, fr fr. 🫢


πŸ’… DESCRIPTION πŸ’…

these functions are lowkey convenience functions, bestie β€” they're part of the machine-independent timecounter(9) framework, and all of them operate with the bintime structure. iconic. ✨

  • bintime_add() β€” adds the time information stored in bt2 to bt. πŸ’–
  • bintime_sub() β€” conversely, subtracts bt2 from bt. πŸ”₯
  • bintime_addx() β€” stores the fraction of a second x to bt. ⭐
  • bintime2timespec() β€” like, the function name literally bespeaks it: converts the bintime structure to struct timespec. πŸ¦‹
  • timespec2bintime() β€” does the opposite. πŸŽ€
  • bintime2timeval() β€” operates with struct timeval instead. 🌸
  • timeval2bintime() β€” also operates with struct timeval instead. πŸ’œ

and the result is stored to the right-hand side, periodt. πŸ‘‘


πŸ¦‹ SEE ALSO πŸ¦‹


mwah πŸ’‹ that's the whole vibe. this page is from Debian, dated June 8, 2010, and it's literally BINTIME_ADD(9) β€” bye bestie! πŸŽ€

πŸ“¦ where this page comes from