mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:08:12 +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:
parent
b2e7b8cdff
commit
fc5cab5c21
29 changed files with 79 additions and 80 deletions
|
@ -329,7 +329,7 @@ ExecuteScriptResultSerialized execute_async_script(Web::Page& page, DeprecatedSt
|
|||
auto* window = page.top_level_browsing_context().active_window();
|
||||
auto& realm = window->realm();
|
||||
auto& vm = window->vm();
|
||||
auto start = Duration::now_monotonic();
|
||||
auto start = MonotonicTime::now();
|
||||
|
||||
// 4. Let promise be a new Promise.
|
||||
auto promise = JS::Promise::create(realm);
|
||||
|
@ -383,7 +383,7 @@ ExecuteScriptResultSerialized execute_async_script(Web::Page& page, DeprecatedSt
|
|||
vm.custom_data()->spin_event_loop_until([&] {
|
||||
if (script_promise.state() != JS::Promise::State::Pending)
|
||||
return true;
|
||||
if (timeout.has_value() && (Duration::now_monotonic() - start) > Duration::from_seconds(static_cast<i64>(*timeout)))
|
||||
if (timeout.has_value() && (MonotonicTime::now() - start) > Duration::from_seconds(static_cast<i64>(*timeout)))
|
||||
return true;
|
||||
return false;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue