mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:28:12 +00:00
LibWeb: Allow performance timestamps to have sub-millisecond precision
Rather than returning the number of whole elapsed milliseconds, we now return the number of elapsed nanoseconds divided by one million. This allows us to make use of the fractional part of the double that is returned.
This commit is contained in:
parent
05c571bf9b
commit
ee765e241e
2 changed files with 2 additions and 2 deletions
|
@ -52,7 +52,7 @@ JS::GCPtr<NavigationTiming::PerformanceTiming> Performance::timing()
|
|||
|
||||
double Performance::time_origin() const
|
||||
{
|
||||
return static_cast<double>(m_timer.origin_time().milliseconds());
|
||||
return static_cast<double>(m_timer.origin_time().nanoseconds()) / 1e6;
|
||||
}
|
||||
|
||||
// https://w3c.github.io/user-timing/#mark-method
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue