mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-31 13:48:25 +00:00
Kernel: Make usleep aware of dynamic tick length
On my system, ticks_per_second() returns 1280. So Serenity was always 20% too fast when sleeping!
This commit is contained in:
committed by
Andreas Kling
parent
782db88e82
commit
4a5a7b68eb
@@ -2436,7 +2436,7 @@ int Process::sys$usleep(useconds_t usec)
|
||||
REQUIRE_PROMISE(stdio);
|
||||
if (!usec)
|
||||
return 0;
|
||||
u64 wakeup_time = Thread::current()->sleep(usec / 1000);
|
||||
u64 wakeup_time = Thread::current()->sleep(usec * TimeManagement::the().ticks_per_second() / 1000000);
|
||||
if (wakeup_time > g_uptime)
|
||||
return -EINTR;
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user