OpenBSD manual page server

Manual Page Search Parameters

BINTIME_ADD(9) Kernel Developer's Manual BINTIME_ADD(9)

bintime_addoperations on “bintime”

#include <sys/time.h>

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

bintime_addx(struct bintime *bt, uint64_t x);

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

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

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

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

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

These functions are provided for convenience as part of the machine-independent timecounter(9) framework. All of them operate with the bintime structure.

The function bintime_add() adds the time information stored in bt2 to bt. Conversely, bintime_sub() subtracts bt2 from bt. The bintime_addx() function stores the fraction of a second x to bt.

Like the function names bespeak, bintime2timespec() converts the bintime structure to struct timespec and timespec2bintime() does the opposite. The functions bintime2timeval() and timeval2bintime() operate with struct timeval instead. The result is stored to the right-hand side.

timeradd(3), timeval(3), bintime(9), timecounter(9)

June 8, 2010 NetBSD-7.0.1