MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / Wait

Function Wait

Kernel/src/arch/x86_64/timer.cpp:108–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106 }
107
108 void Wait(long ms){
109 assert(ms > 0);
110
111 uint64_t ticksPerMs = (Timer::GetFrequency() / 1000);
112 uint64_t timeMs = Timer::GetSystemUptime() * 1000 + (Timer::GetTicks() * ticksPerMs);
113
114 while((Timer::GetSystemUptime() * 1000 + (Timer::GetTicks() * ticksPerMs)) - timeMs <= static_cast<unsigned long>(ms));
115 }
116
117 void SleepCurrentThread(long ticks){
118 SleepBlocker blocker = SleepBlocker(ticks);

Callers

nothing calls this directly

Calls 3

GetFrequencyFunction · 0.85
GetSystemUptimeFunction · 0.85
GetTicksFunction · 0.85

Tested by

no test coverage detected