script: Stop using time in DOM timers (#33262)

This switches to using `std::time` types for DOM timer operations, which
allows removing our custom time units in favor of `Duration`.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson 2024-08-30 17:20:44 +02:00 committed by GitHub
parent 8a0c7487e7
commit a4ceb82ef5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 78 additions and 106 deletions

View file

@ -64,10 +64,9 @@ impl TimerScheduler {
/// Handle an incoming timer request.
pub fn handle_timer_request(&mut self, request: TimerSchedulerMsg) {
let TimerEventRequest(_, _, _, delay) = request.0;
let schedule = Instant::now() + Duration::from_millis(delay.get());
let event = ScheduledEvent {
request: request.0,
for_time: schedule,
for_time: Instant::now() + delay,
};
self.0.push(event);
}