kernel/timer: Slightly optimize spin().

Move the math operation out of the loop.
This commit is contained in:
Augustin Cavalier
2025-08-30 11:28:19 -04:00
parent 13e97a61cc
commit 6a3146aad9
+2 -2
View File
@@ -446,8 +446,8 @@ cancel_timer(timer* event)
void
spin(bigtime_t microseconds)
{
bigtime_t time = system_time();
bigtime_t target = system_time() + microseconds;
while ((system_time() - time) < microseconds)
while (system_time() < target)
cpu_pause();
}