Lines Matching refs:ns
12 nstime_init(nstime_t *time, uint64_t ns) { in nstime_init() argument
13 time->ns = ns; in nstime_init()
18 time->ns = sec * BILLION + nsec; in nstime_init2()
23 return time->ns; in nstime_ns()
28 return time->ns / MILLION; in nstime_msec()
33 return time->ns / BILLION; in nstime_sec()
38 return time->ns % BILLION; in nstime_nsec()
48 return (a->ns > b->ns) - (a->ns < b->ns); in nstime_compare()
53 assert(UINT64_MAX - time->ns >= addend->ns); in nstime_add()
55 time->ns += addend->ns; in nstime_add()
60 assert(UINT64_MAX - time->ns >= addend); in nstime_iadd()
62 time->ns += addend; in nstime_iadd()
69 time->ns -= subtrahend->ns; in nstime_subtract()
74 assert(time->ns >= subtrahend); in nstime_isubtract()
76 time->ns -= subtrahend; in nstime_isubtract()
81 assert((((time->ns | multiplier) & (UINT64_MAX << (sizeof(uint64_t) << in nstime_imultiply()
82 2))) == 0) || ((time->ns * multiplier) / multiplier == time->ns)); in nstime_imultiply()
84 time->ns *= multiplier; in nstime_imultiply()
91 time->ns /= divisor; in nstime_idivide()
96 assert(divisor->ns != 0); in nstime_divide()
98 return time->ns / divisor->ns; in nstime_divide()