How does a browser clock actually get the time?
Date.now() does not fetch time from the internet. It asks the operating system a single question: "What time is it right now?"
The operating system keeps time using a quartz crystal oscillator inside your computer or phone. That crystal vibrates at a precise frequency, and the system counts those vibrations to track the passage of time. Temperature changes, age, and manufacturing tolerances cause the crystal to vibrate slightly faster or slower. This creates drift.
To correct drift, the operating system periodically contacts a time server using the Network Time Protocol (NTP). On modern Windows, this sync happens roughly every 64 minutes. macOS and Linux sync more often, typically every 15 to 30 minutes. Between syncs, your system relies entirely on that quartz crystal.
A typical consumer device drifts 1 to 15 seconds per month. The worst 10 percent of internet-connected desktops in a 2022 study were off by more than 8 seconds; the median sat within 2.5 seconds of NTP time.
How a dedicated hardware clock works
A dedicated hardware clock has its own time source. It does not depend on an operating system or a network connection.
Atomic clocks use the oscillation of cesium or rubidium atoms. They are Stratum 0 devices in the NTP hierarchy. You will not find one on your desk.
GPS receivers contain a quartz oscillator that is constantly disciplined by the atomic clocks on GPS satellites. Many time servers use GPS receivers as their reference.
Radio-controlled clocks pick up signals from national time stations like WWVB (US), DCF77 (Germany), or MSF (UK). These stations broadcast the official time, synchronized to national atomic clocks. Accuracy is typically within 10 milliseconds of the broadcast time.
Dedicated NTP appliances are small devices that contain a GPS or radio receiver and run NTP server software. They provide time to an entire local network with sub-millisecond accuracy.
Where the accuracy gap matters
For most everyday uses, the difference does not matter. Checking the time, setting a meeting alarm, or timing a 25-minute Pomodoro session does not require atomic precision.
The gap matters in four situations.
Legal and evidentiary timing. Deposition rooms, interrogation rooms, and courtrooms often need a time source that can be certified as accurate. A browser clock on a laptop that syncs via NTP every hour is not certifiable. A dedicated GPS clock with a calibration certificate is.
Broadcast and streaming. When a live stream overlay shows a countdown to a scheduled event, viewers in different countries see that countdown. If the browser clock on the streaming PC is 3 seconds slow, every viewer sees the wrong countdown. Professional broadcasters use GPS-locked clocks for this reason.
Laboratory experiments. If you are timing a chemical reaction or a behavioral study, sub-second precision matters. A browser clock adds variable latency from the rendering pipeline: typically 16 to 50 milliseconds per frame, potentially more under load. A dedicated stopwatch with a hardware timer does not have this problem.
High-frequency trading. Trading algorithms operate on microsecond and nanosecond timescales. No browser-based clock is relevant here. Financial firms use PTP (Precision Time Protocol) with hardware timestamps from switches.
Can you tighten a browser clock's accuracy?
Between NTP syncs, your system clock drifts. You can reduce that drift.
Use a local NTP server. If a device on your network runs an NTP service (a Raspberry Pi with a GPS hat, or a router that supports NTP), configure your computers to sync to it. Local syncs happen more frequently and with lower latency than internet syncs.
Check your sync interval. On Windows, run w32tm /query /status to see when your last sync was and how often it happens. On macOS, ntpq -p shows your NTP peers and their offsets. On Linux, timedatectl shows the NTP service status.
Use a browser clock that is honest about its limits. A good browser clock uses requestAnimationFrame for smooth updates, displays milliseconds only for reference (not as a claim of precision), and never claims to be atomic-accurate. It tells the truth: it reads your system clock, and your system clock is only as good as your hardware and connection.