1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:27:35 +00:00

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.
This commit is contained in:
Andrew Kaster 2023-01-01 22:30:31 -07:00 committed by Linus Groh
parent 82a01bf32f
commit 4afa6e264c
3 changed files with 12 additions and 26 deletions

View file

@ -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());
}
}