| 97 | } |
| 98 | |
| 99 | pub fn wait_block(ms: u64) { |
| 100 | let current = TIME_MS.load(Ordering::Relaxed); |
| 101 | loop { |
| 102 | if TIME_MS.load(Ordering::Relaxed) > current + ms { |
| 103 | break; |
| 104 | } else { |
| 105 | x86_64::instructions::nop(); |
| 106 | x86_64::instructions::nop(); |
| 107 | x86_64::instructions::nop(); |
| 108 | x86_64::instructions::nop(); |
| 109 | x86_64::instructions::nop(); |
| 110 | x86_64::instructions::nop(); |
| 111 | x86_64::instructions::nop(); |
| 112 | x86_64::instructions::nop(); |
| 113 | } |
| 114 | } |
| 115 | } |
| 116 | pub async fn a_sleep(ms: u64) { |
| 117 | let timer = Timer::new(ms); |
| 118 | timer.await; |