Sleep a number of microseconds
(micros: u64)
| 39 | |
| 40 | /// Sleep a number of microseconds |
| 41 | pub fn sleep(micros: u64) { |
| 42 | let duration = Duration::from_micros(micros); |
| 43 | #[cfg(not(feature = "uefi"))] |
| 44 | { |
| 45 | thread::sleep(duration); |
| 46 | } |
| 47 | #[cfg(feature = "uefi")] |
| 48 | { |
| 49 | // TODO: It's not recommended to use this for sleep more than 10ms |
| 50 | // Should use a one-shot timer event |
| 51 | uefi::boot::stall(duration); |
| 52 | } |
| 53 | } |
no outgoing calls
no test coverage detected