diff options
author | Andrew Kaster <akaster@serenityos.org> | 2023-01-01 22:30:31 -0700 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-01-07 14:51:04 +0100 |
commit | 4afa6e264c91764d27f8f0674b2835cd37ca90ab (patch) | |
tree | e7bbba0958821fa461aa229618be90ba0227e2c4 /Userland/Libraries/LibWeb/HighResolutionTime | |
parent | 82a01bf32f94911de7e3d864b0c22c6cb857bf2b (diff) | |
download | serenity-4afa6e264c91764d27f8f0674b2835cd37ca90ab.zip |
LibCore+LibWeb: Use AK::Time instead of timeval in Core::ElapsedTimer
This removes the direct dependency on sys/time.h from ElapsedTimer, and
makes the code a lot cleaner by using the helpers from AK::Time for
time math and getting the current timestamp.
Diffstat (limited to 'Userland/Libraries/LibWeb/HighResolutionTime')
-rw-r--r-- | Userland/Libraries/LibWeb/HighResolutionTime/Performance.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/HighResolutionTime/Performance.cpp b/Userland/Libraries/LibWeb/HighResolutionTime/Performance.cpp index d73c1321e2..67ec50f83d 100644 --- a/Userland/Libraries/LibWeb/HighResolutionTime/Performance.cpp +++ b/Userland/Libraries/LibWeb/HighResolutionTime/Performance.cpp @@ -39,8 +39,7 @@ JS::GCPtr<NavigationTiming::PerformanceTiming> Performance::timing() double Performance::time_origin() const { - auto origin = m_timer.origin_time(); - return (origin.tv_sec * 1000.0) + (origin.tv_usec / 1000.0); + return static_cast<double>(m_timer.origin_time().to_milliseconds()); } } |