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

Function sleep

src/time.rs:121–129  ·  view source on GitHub ↗

Sleep

(sec: f64)

Source from the content-addressed store, hash-verified

119
120// Sleep
121pub fn sleep(sec: f64)
122{
123 let start = crate::clock::uptime();
124
125 while crate::clock::uptime() - start < sec
126 {
127 halt();
128 }
129}
130
131
132// Wait (in nanoseconds)

Callers 1

initFunction · 0.70

Calls 2

haltFunction · 0.85
uptimeFunction · 0.70

Tested by

no test coverage detected