Time Precision in Computing: Why Nanoseconds, NTP, and Leap Seconds All Matter
Nanoseconds define CPU cache speeds; milliseconds define user experience; microseconds determine whether distributed database clocks can be trusted. Here's the computing time hierarchy, NTP clock synchronisation, why leap seconds cause outages, and what P99 latency means.
By sadiqbd Β· June 10, 2026
Microseconds matter in computing in ways that affect millions of users simultaneously
A database query that takes 50 milliseconds instead of 5 milliseconds isn't just 10Γ slower. Multiplied across millions of requests per day, it means servers spend 10Γ as much time waiting, and user-facing response times deteriorate correspondingly. At the level of distributed systems, nanoseconds determine whether clock synchronisation is reliable enough to avoid data corruption. Understanding time precision in computing transforms millisecond-level performance decisions from abstract into practical.
Time units in computing
Nanosecond (ns) = 10β»βΉ seconds: The fundamental time unit for CPU operations. A 3 GHz processor completes approximately one cycle every 0.33 nanoseconds. Memory access times: L1 cache ~1 ns, L2 cache ~4 ns, L3 cache ~10 ns, RAM ~100 ns.
Microsecond (ΞΌs) = 10β»βΆ seconds: Network packet processing, system call overhead, SSD read times (~50β100 ΞΌs for NVMe). The gap between L3 cache and SSD (~10 ns vs ~50 ΞΌs) is roughly 5,000Γ β one of the largest performance gaps in the memory hierarchy.
Millisecond (ms) = 10β»Β³ seconds: The unit of most practical web performance measurement. Database query times, API response times, HTTP request latency. Human perception of interface responsiveness begins around 50β100 ms (responses faster than 50 ms feel instantaneous; responses over 1,000 ms feel like a wait).
Second (s): Video latency thresholds (HLS streaming ~6β10 seconds latency; WebRTC ~50β200 ms). Page load times. Timeout thresholds for most HTTP requests.
The memory hierarchy and why nanoseconds matter
The computer memory hierarchy is structured around the fundamental speed/capacity trade-off: faster memory is smaller and more expensive:
| Storage | Typical access time | Relative size | Cost |
|---|---|---|---|
| CPU registers | <1 ns | Bytes | β |
| L1 cache | 1β4 ns | 32β64 KB | β |
| L2 cache | 4β12 ns | 256 KB β 1 MB | β |
| L3 cache | 10β40 ns | 4β64 MB | β |
| RAM (DRAM) | 50β100 ns | GB range | ~$3β5/GB |
| NVMe SSD | 20β100 ΞΌs | TB range | ~$0.10/GB |
| SATA SSD | 100β500 ΞΌs | TB range | ~$0.05/GB |
| HDD | 5β10 ms | TB range | ~$0.02/GB |
| Network (LAN) | ~100 ΞΌsβ1 ms | β | β |
| Network (transatlantic) | 60β80 ms | β | β |
The jump from RAM to SSD (100 ns β 20 ΞΌs) is roughly 200β500Γ. The jump from SSD to HDD (100 ΞΌs β 10 ms) is roughly 100Γ. Every database or application that stores "hot" data in memory rather than on disk exploits these gaps.
NTP: keeping distributed clocks in sync
Every server has a hardware clock that drifts β a typical computer clock drifts 1β2 seconds per day without correction. In a distributed system, clocks across hundreds or thousands of servers drifting independently would make log timestamps meaningless and distributed transactions unreliable.
Network Time Protocol (NTP) synchronises clocks across the network:
- NTP clients query NTP servers (or pool servers like
pool.ntp.org) - The protocol accounts for network latency in the synchronisation
- Achieves precision of 1β100 milliseconds on the internet; ~10 microseconds on a local network with a GPS-disciplined reference
Precision Time Protocol (PTP, IEEE 1588): For applications requiring sub-microsecond precision (financial trading systems, industrial automation, telecommunications), PTP achieves ~100 nanosecond accuracy on dedicated hardware with timestamping in the network interface.
Why clock sync matters for databases: Distributed databases like Google Spanner use precisely synchronised clocks to determine transaction ordering. Google's TrueTime API provides timestamps with bounded uncertainty (knowing that the actual time is somewhere in a range Β±Ξ΅). Transactions that need to be globally ordered can wait out the uncertainty window (~7 ms) to ensure causal consistency.
Leap seconds: the time system's awkward patch
The Earth's rotation is not perfectly uniform β it slows slightly over time due to tidal friction from the Moon. Atomic clocks, which are extremely precise, gradually diverge from astronomical time (defined by Earth's rotation).
To keep UTC (Coordinated Universal Time) within 0.9 seconds of astronomical time (UT1), the IERS (International Earth Rotation and Reference Systems Service) occasionally adds a "leap second" β inserting an extra second at 23:59:60 UTC.
Why leap seconds cause problems: Software assumes 60 seconds per minute. A minute with 61 seconds breaks clock code that isn't explicitly designed to handle it. Leap second events have caused outages at:
- Linux systems where the leap second caused high CPU load due to a kernel bug (2012)
- Cloudflare, which had a service outage due to a leap second handling bug (2017)
- Reddit, which also had disruption during a leap second insertion
The solution: the tech industry pushed for abandoning leap seconds. In November 2022, BIPM (the international measurement body) voted to phase out leap seconds by 2035, instead allowing UTC to drift from UT1 up to 1 minute before a future correction mechanism is applied.
Latency in web performance
Core Web Vitals context (LCP, INP, CLS) targets millisecond thresholds. Understanding why:
User perception of response time:
- < 100 ms: feels instantaneous
- 100β300 ms: noticeable but acceptable
- 300 msβ1 s: user is aware of the wait
- 1β3 s: users begin to abandon; attention breaks
-
3 s: significant abandonment; user frustration
Server response time (TTFB β Time to First Byte): Google's Core Web Vitals define TTFB < 800 ms as good. TTFB is composed of:
- DNS resolution: 10β200 ms
- TCP connection: 10β100 ms
- TLS handshake: 20β200 ms
- Server processing: 0 ms β seconds
- First byte transfer: network dependent
Reducing server processing time from 500 ms to 50 ms saves 450 ms β often more impactful than front-end optimisation.
How to use the Time Converter on sadiqbd.com
- Enter the time value and source unit β nanoseconds, microseconds, milliseconds, seconds, minutes, hours, days, weeks, months, years
- Convert β see equivalents across all time units
- Apply to performance contexts β convert database query times or latency requirements between units for comparison
Frequently Asked Questions
How do computers measure time with nanosecond precision?
Modern CPUs have a high-resolution performance counter (RDTSC on x86) that increments with each processor cycle. At 3 GHz, this gives ~0.33 ns resolution. Operating systems expose this via high-resolution timers: clock_gettime(CLOCK_MONOTONIC) in Linux, QueryPerformanceCounter on Windows.
What causes the P99 latency tail to be so much worse than median? P99 latency (the 99th percentile β worse than 99% of requests) is affected by garbage collection pauses, lock contention, OS scheduling jitter, and intermittent network issues. These rare events don't appear in average or median latency but dramatically affect users who hit them.
Is the Time Converter free? Yes β completely free, no sign-up required.
Time precision in computing spans 18 orders of magnitude β from nanoseconds in CPU caches to the years-long timescales of data retention. Understanding where your application operates in that range shapes every performance decision.
Try the Time Converter free at sadiqbd.com β convert between nanoseconds, microseconds, milliseconds, seconds, hours, days, and years instantly.