MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ffclock_difftime

Function ffclock_difftime

freebsd/kern/kern_ffclock.c:131–150  ·  view source on GitHub ↗

* Feed-forward difference clock. This should be the preferred way to convert a * time interval in ffcounter values into a time interval in seconds. If a valid * pointer is passed, an upper bound on the error in computing the time interval * in seconds is provided. */

Source from the content-addressed store, hash-verified

129 * in seconds is provided.
130 */
131void
132ffclock_difftime(ffcounter ffdelta, struct bintime *bt,
133 struct bintime *error_bound)
134{
135 ffcounter update_ffcount;
136 uint32_t err_rate;
137
138 ffclock_convert_diff(ffdelta, bt);
139
140 if (error_bound) {
141 do {
142 update_ffcount = ffclock_estimate.update_ffcount;
143 err_rate = ffclock_estimate.errb_rate;
144 } while (update_ffcount != ffclock_estimate.update_ffcount);
145
146 ffclock_convert_diff(ffdelta, error_bound);
147 /* 18446744073709 = int(2^64/1e12), err_bound_rate in [ps/s] */
148 bintime_mul(error_bound, err_rate * (uint64_t)18446744073709LL);
149 }
150}
151
152/*
153 * Create a new kern.sysclock sysctl node, which will be home to some generic

Callers 3

ffclock_bindifftimeFunction · 0.85
ffclock_nanodifftimeFunction · 0.85
ffclock_microdifftimeFunction · 0.85

Calls 2

ffclock_convert_diffFunction · 0.85
bintime_mulFunction · 0.85

Tested by

no test coverage detected