mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:07:34 +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:
parent
82a01bf32f
commit
4afa6e264c
3 changed files with 12 additions and 26 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue