1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-29 17:35:06 +00:00

Everywhere: Use MonotonicTime instead of Duration

This is easily identifiable by anyone who uses Duration::now_monotonic,
and any downstream users of that data.
This commit is contained in:
kleines Filmröllchen 2023-03-17 19:50:39 +01:00 committed by Jelle Raaijmakers
parent b2e7b8cdff
commit fc5cab5c21
29 changed files with 79 additions and 80 deletions

View file

@ -1585,7 +1585,7 @@ WebIDL::ExceptionOr<void> HTMLMediaElement::dispatch_time_update_event()
ScopeGuard guard { [this] { m_running_time_update_event_handler = false; } };
m_running_time_update_event_handler = true;
m_last_time_update_event_time = Duration::now_monotonic();
m_last_time_update_event_time = MonotonicTime::now();
dispatch_event(TRY(DOM::Event::create(realm(), HTML::EventNames::timeupdate)));
return {};
@ -1617,7 +1617,7 @@ void HTMLMediaElement::time_marches_on(TimeMarchesOnReason reason)
auto dispatch_event = true;
if (m_last_time_update_event_time.has_value()) {
auto time_since_last_event = Duration::now_monotonic() - *m_last_time_update_event_time;
auto time_since_last_event = MonotonicTime::now() - *m_last_time_update_event_time;
dispatch_event = time_since_last_event.to_milliseconds() > 250;
}