mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-02-04 06:23:45 +00:00
use same now timestamp for both priorities
This commit is contained in:
@@ -273,13 +273,14 @@ pub fn after(
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn run(self: *Scheduler) !?u64 {
|
pub fn run(self: *Scheduler) !?u64 {
|
||||||
self.runTasks(.low);
|
const now = milliTimestamp(.monotonic);
|
||||||
return self.runTasks(.high);
|
|
||||||
|
self.runTasks(.low, now);
|
||||||
|
return self.runTasks(.high, now);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Runs events of the desired tree.
|
/// Runs events of the desired tree.
|
||||||
fn runTasks(self: *Scheduler, comptime prio: Priority) if (prio == .low) void else ?u64 {
|
fn runTasks(self: *Scheduler, comptime prio: Priority, now: u64) if (prio == .low) void else ?u64 {
|
||||||
const now = milliTimestamp(.monotonic);
|
|
||||||
const tree = if (comptime prio == .low) &self.low_priority else &self.high_priority;
|
const tree = if (comptime prio == .low) &self.low_priority else &self.high_priority;
|
||||||
|
|
||||||
while (tree.peek()) |task| {
|
while (tree.peek()) |task| {
|
||||||
|
|||||||
Reference in New Issue
Block a user