GYNK  /  Apps  /  Prime Time

Prime Time App Icon

Millisecond precision.
How it works.

Your iPhone's clock is "close enough." Prime Time NTP isn't satisfied with that.
Here's the full story — from the NTP query to the digit you see on screen.
Now with Pro features: manual sync, always-on display, and up to 30 servers.

--:--:--.---
The Basics Reading the UI Under the Hood Pro Features
01 — The Basics

Ask the source.
Not the device.

Prime Time NTP bypasses your device's internal clock entirely. Instead, it queries NTP (Network Time Protocol) servers directly — the same global infrastructure that keeps the internet synchronized — and calculates the correct time from their responses.

By default, three high-reliability servers are queried in parallel: time.google.com, time.aws.com, and pool.ntp.org. Their answers are fused statistically to produce a single, trustworthy result. You can register up to 5 servers in the free plan, or expand to 30 servers simultaneously with Prime Time Pro.

Why multiple servers?

A single server query is subject to momentary congestion, routing asymmetry, and outlier responses. Querying multiple servers simultaneously allows Prime Time NTP to detect and discard anomalous results, then weight the remaining answers by their network latency. The lower the round-trip time, the more trustworthy the response.

Config Screen

All server management — adding, removing, and reordering NTP hosts — is handled in the Config screen. The query interval, server count, and Pro feature toggles are also found here.

Server Nodes  ●  syncing
Host Offset / RTT Status
time.google.com
INT: 45s  •  S1  •  GPS
OFF
RTT
+0.003s 18ms T-032.4
time.aws.com
INT: 15s  •  S1
OFF
RTT
+0.008s 34ms T-008.1
pool.ntp.org
INT: 120s  •  S2
OFF
RTT
+0.002s 22ms T-097.8
02 — Reading the UI

Every number
has a meaning.

The large HH:mm:ss at the top is the NTP-corrected current time. The .000 beneath it is the millisecond component — the display loop fires every 1 ms via TimelineView(.periodic(by: 0.001)), with actual render frequency capped at the device's ProMotion refresh rate (up to 120 Hz). The thin cyan progress bar below represents the fractional position within the current second — it sweeps from left to right in exactly one second.

Graph Panels

Both graphs display a rolling 5-minute (300 s) history window. Data points older than 5 minutes are pruned automatically; one anchor point just outside the window is kept to ensure the sparkline always draws a continuous line to the left edge.

GLOBAL OFFSET (5m) shows the weighted-average difference between the NTP-fused time and your device's internal clock. A value close to zero means your device clock happens to be accurate at this moment.

σ DEVIATION (5m) is the standard deviation of offsets across all active servers in the current fusion set. Smaller is better. The color of this panel reflects overall sync quality.

Green
σ < 5 ms
High precision
Yellow
σ < 50 ms
Normal
Red
σ ≥ 50 ms
Unstable
Global Offset (5m)
+0.003s
σ Deviation (5m)
±0.002s

Server Row Legend

Status dot

Success
Querying
Idle
Failed

T- countdown

Seconds until next
server query

INT: Xs

Current query
interval (15–180 s)

S1 · S2 … (cyan)

Stratum level reported by the server.
S1 = directly GPS/atomic-locked.
S2 = synced to a Stratum-1 source.

GPS · PPS · ATOM … (orange)

Reference ID from the NTP packet.
Shown only for Stratum 0–1 servers where the ID is a human-readable ASCII tag. IPv4 upstream addresses (Stratum 2+) are intentionally hidden.
03 — Under the Hood

Why you can trust
the decimal places.

RTT & One-Way Delay Correction

The time between sending an NTP request and receiving the response is called the Round-Trip Time (RTT). The timestamp the server returns reflects the moment the server sent its packet — not the moment you received it. By the time your device reads it, half the RTT has already elapsed.

Prime Time NTP records CACurrentMediaTime() immediately before sending the UDP packet (t1) and again the instant the response arrives (t4). RTT is computed as t4 − t1, then RTT ÷ 2 is added to the server's transmit timestamp before it enters any further calculation.

// Monotonic snapshots bracket the UDP exchange t1Monotonic = CACurrentMediaTime() // … UDP send → server → UDP receive … t4Monotonic = CACurrentMediaTime() rtt = t4Monotonic − t1Monotonic // Correct for one-way transit corrected = ntpTransmitTime + (rtt / 2)

Monotonic Clock — No OS Interference

iOS's Date() can jump forward or backward when the OS applies a time correction. Prime Time NTP avoids this by using CACurrentMediaTime() — a monotonic clock that counts elapsed seconds since boot without ever being adjusted.

When an NTP result arrives, Prime Time NTP records both the corrected NTP time and the current monotonic value as a pair. Every subsequent display frame computes the current time as:

NTP-corrected absolute time
referenceNTPTime  =  12:00:00.018
recorded simultaneously
Monotonic clock snapshot
referenceMonotonicTime  =  3600.000 s
0.5 seconds later, on display refresh
Displayed time
12:00:00.018 + (3600.500 − 3600.000) =  12:00:00.518
Key point: The device's internal clock is never read for display purposes. Only the NTP reference time and the monotonic elapsed delta are used. OS time corrections cannot disturb what you see on screen.

RTT-Weighted Multi-Server Fusion

Each server's answer is assigned a weight inversely proportional to its RTT. A server that responds in 18 ms is weighted more heavily than one that takes 80 ms, because a shorter round-trip implies a smaller and more symmetric propagation uncertainty. Responses that fall outside two standard deviations from the median are discarded before the weighted average is computed. With Prime Time Pro, up to 30 servers contribute to this fusion — giving statistically superior accuracy and the ability to detect regional anomalies in real time.

// Weight formula: lower RTT → higher weight weight = 1.0 / (rtt + 0.001) // Example with three servers google  RTT=18ms    weight ≈ 55.6 aws    RTT=34ms    weight ≈ 29.4 pool   RTT=22ms    weight ≈ 45.5 // Outlier removal: discard if |estimate − median| > 2σ outlier    excluded // RTT-weighted average of remaining responses result  =  median + Σ(offset × weight) / Σ(weight)

Network Layer — Apple Network Framework

Each NTP query is sent as a raw UDP datagram to port 123 using Apple's Network.framework (NWConnection), bypassing the system time stack entirely. A 5-second timeout is enforced per query; a non-responding server is marked failed and its interval resets to the 15 s minimum.

On launch, each server's first query is staggered by a random delay of 0–3 seconds to avoid simultaneous DNS lookups and UDP bursts. The same 0–3 s jitter is appended to every subsequent interval, preventing servers from synchronising into lockstep over time.

When the app returns from the background, all servers re-query immediately — the scheduler fires without waiting for the next scheduled interval — so the monotonic reference is always anchored to a fresh result the moment you pick up your device.

// byte 0 = 0x1B → LI=0, VN=3 (NTP v3), Mode=3 (client) packet[0] = 0x1B // byte 1 → Stratum level // bytes 12–15 → Reference ID // Stratum 0–1 → ASCII tag (e.g. GPS, PPS, ATOM) // Stratum 2+ → upstream server IPv4 (not shown in UI) // bytes 40–47 → Transmit Timestamp (64-bit NTP fixed-point)

Adaptive Query Interval

Prime Time NTP adjusts how often each server is queried based on the stability of its responses. When a server is delivering consistent results (σ < 5 ms over the last 5+ responses), the interval expands by ×1.5 each cycle up to the 180 s ceiling — reducing server load. When variance spikes above 50 ms, the interval resets to the minimum 15 s immediately to re-establish a reliable reference.

Stable
×1.5 → 180s

σ < 5 ms over 5+ responses. Interval multiplied by 1.5 each cycle, capped at 180 s.

Unstable
reset → 15s

σ > 50 ms detected. Interval immediately resets to 15 s minimum to re-sync quickly.

Note on always-on display: When Prime Time Pro's Keep Screen On toggle is enabled in Config, UIApplication.shared.isIdleTimerDisabled is set to true for the duration the app is in the foreground. The display will never sleep while you are actively monitoring your servers.
04 — Prime Time Pro

More servers.
More control.

★ Pro Plan

Prime Time Pro is a one-time purchase. There are no subscriptions, no recurring fees, and no expiry dates. Once unlocked, your Pro status is securely linked to your Apple ID and can be easily restored to any of your devices.

The free tier remains fully functional: up to 5 NTP servers, real-time millisecond display, sparkline graphs, offset and RTT history, Stratum level, and Reference ID — all available without a purchase.

$9.99 One-time purchase
Restores to all your devices

To unlock, tap "Unlock Pro" in the Config screen. To restore a previous purchase on a new device, tap "Restore Purchases" — no re-payment required.

Manual Sync

The sync button in the top-right corner of the main screen triggers an immediate NTP query to all registered servers. Internally, it resets every server's nextSyncDate to now, so the 1-second scheduler loop fires each query on its very next tick. The results flow through the same RTT correction, outlier rejection, and weighted-fusion pipeline as any automatic query — you get a verified, freshly-fused timestamp within seconds. Available to Pro users only; the button is visible but locked for free users.

🖥
Always-On Display

The Keep Screen Awake toggle in Config sets UIApplication.shared.isIdleTimerDisabled = true for as long as the app is in the foreground. The screen never sleeps mid-monitoring session. The setting is persisted via UserDefaults and restored on next launch — but only if Pro is still active. Backgrounding the app or revoking Pro automatically re-enables the idle timer.

🗄
Up to 30 NTP Servers

The server limit is enforced in both the Config screen (add button is blocked beyond the cap, with an alert explaining the limit) and at load time (saved lists are silently trimmed to 5 if Pro is not active). With Pro, the cap rises to 30 simultaneously queried hosts. More servers feed into the RTT-weighted fusion, tightening the statistical accuracy of the global offset and making regional latency anomalies immediately visible.

Feature Free Pro — $9.99
Millisecond display at 120 fps
NTP servers (simultaneous) Up to 5 Up to 30
RTT-weighted multi-server fusion
Offset & RTT sparkline graphs
Stratum & Reference ID per server
Adaptive query interval (15–180 s)
Manual sync (on-demand query)
Always-on display
Purchase type Free One-time · no subscription
Restore to new device via Apple ID
← Back to Home All Apps