Skip to Content
Platform.Ontology

High resolution timer precision

performance.now() returns a clock whose coarseness depends on browser and isolation.

Gets silentlySpeed and timingTimersWeb browsersWhen the page loads

In one line

Can use a clock whose sharpness shows your browser and privacy mode

performance.now() returns a clock whose coarseness depends on browser and isolation.

Timer resolution is a deliberate defense against timing attacks. The resolution itself tells a site the browser and whether privacy mode or cross-origin isolation is on, and limits attacks like cache timing.

What it can and can't do

What the user does: Nothing. It happens when the page loads

It can

  • Check how fine the page timer is
  • Guess your browser from that sharpness
  • Tell if privacy mode or cross origin protection is on

It cannot

  • Get a very sharp clock without extra protections
  • Ask permission first
  • See your files
  • Know who you are by itself

Browser support

BrowserStatusFirst versionReleasedNote
ChromeSupported242013-01-10None
EdgeSupported122015-07-29None
FirefoxSupported152012-08-28None
SafariSupported82014-10-16None
Safari on iPhoneSupported92015-09-16None
Chrome on AndroidSupported252013-02-27None
Samsung InternetSupported1.52013-09-25None

How a site asks for it

APIperformance.now(); Date.now(); crossOriginIsolated
Browser compat keysapi.Performance.now
How access is grantednone
What the user seesNot listed
Needs a secure context (HTTPS)No
Needs a user gestureNo
How long it lastsNot listed
How to take it backNot listed
Inside an iframeNot listed

Typical flow

  1. Call performance.now() in a tight loop
  2. Compute smallest nonzero delta
  3. Infer resolution and jitter

Data you get

What comes back: Milliseconds since time origin, fractional
Shape: float

FieldTypeUnitRangePrecision
performance.now() Chrome defaultfloatms0 to unbounded100 microseconds (jittered)
Chrome cross-origin isolatedfloatms0 to unbounded5 microseconds
Firefox defaultfloatms0 to unbounded1 ms (RFP: 16.67 ms)
Safarifloatms0 to unbounded1 ms
Firefox cross-origin isolatedfloatms0 to unbounded20 microseconds

Technical limits

  • Cannot get nanosecond timing without cross-origin isolation (and still limited to about 5 microseconds)
  • Jitter added per page, repeated sampling can average it out

The story

What it is

performance.now() gives a very fast clock, but browsers deliberately make it coarser unless the site is isolated.

For you

You never see it. It is why games and videos stay in sync. Browsers blur this clock on purpose to protect you from timing attacks, so most pages get a slightly rounded time.

For makers

Games, audio tools and animation need good timing to run smoothly. Browsers round the timer to stop attacks and fingerprinting, and give a finer clock only to isolated pages. The rounding level is also a clue about your browser.

Where you see it

TypeExampleApps
gamesA browser game uses the clock to step physics at an even rate, so movement does not jitter.Krunker.io, Shell Shockers
musicA web synth or DAW uses precise time to line up notes on the beat.Soundtrap, BandLab
videoA video call tool measures delay to adjust how it buffers voice and picture.Google Meet
analyticsA speed monitoring tool uses it to time page steps from real visitors.Datadog RUM
securityResearchers have shown fine timers can be abused for timing attacks, so browsers round them.None named
adsA tracker tests how coarse the clock is to guess which browser and privacy mode you use.None named
creativeA web animation tool uses precise timing to keep previews smooth.Figma

Risks

  • Precision hints at your browser
  • Fine timers raise attack risk

What the platform says

  • MDN: performance.now(). Returns a high resolution time for measuring how long things take, with precision limited for security.
  • web.dev: Why COOP and COEP. Google explains that precise timers return only on pages that prove they are isolated from other sites.

Good uses and abuse

Legitimate uses

  • Profiling and animation timing

Known abuse

  • Side-channel attacks need finer timers; resolution fingerprints browser mode

Scores

ScoreValueMeaning
Sensitivity1 of 5How revealing the data is
Utility3 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bits1Rough identifying entropy, when known

History

  • 2018-01, all: Spectre: Chrome, Firefox, Safari coarsen performance.now() and Date; SharedArrayBuffer disabled
  • 2018-03, Firefox 60: 1 ms precision default
  • 2021-01, Firefox 79: Finer 20 microsecond precision only when cross-origin isolated
  • 2021-05, Chrome 91: 100 microsecond cap on all platforms; 5 microseconds if cross-origin isolated

Sources

How well checked: Checked against real behavior.

On this page