MCPcopy Create free account
hub / github.com/LibertyOS-Development/kernel / nwait

Function nwait

src/time.rs:133–141  ·  view source on GitHub ↗

Wait (in nanoseconds)

(nsec: u64)

Source from the content-addressed store, hash-verified

131
132// Wait (in nanoseconds)
133pub fn nwait(nsec: u64)
134{
135 let start = rdtsc();
136 let delta = nsec * CLOCK_PER_NS.load(Ordering::Relaxed);
137 while rdtsc() - start < delta
138 {
139 spin_loop();
140 }
141}
142
143
144// Set PIT frequency divider

Callers 2

driveselMethod · 0.85
waitMethod · 0.85

Calls 2

rdtscFunction · 0.85
loadMethod · 0.80

Tested by

no test coverage detected