mirror of
https://github.com/servo/servo.git
synced 2025-08-10 07:55:33 +01:00
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:
parent
8a0c7487e7
commit
a4ceb82ef5
13 changed files with 78 additions and 106 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue