โ† Projects
06 / 09 - Python ยท Desktop ยท Networking

Multi-NTP
Time Sync

A Windows desktop app that synchronises the system clock against many NTP servers at once and applies the median offset with microsecond precision.

PythonCustomTkinter ntplibNTP v4 Windows APIpystray
View on GitHub โ†—

What it does

Rather than trusting a single time source, the tool queries dozens of servers concurrently and takes the median offset, so one misbehaving or drifting server cannot skew the result.

Corrections are written through the Windows FILETIME API at 100-nanosecond resolution, with rounding applied before scaling to avoid floating-point drift. A live clock updates at 30 fps.

Key capabilities

01
Multi-server median
Queries all active servers simultaneously and uses the median offset to reject outliers.
02
Microsecond precision
Offsets shown in microseconds; time set via Windows FILETIME at 100 ns resolution.
03
150+ server catalog
Google, Cloudflare, Amazon, NIST, Apple and regional pools built in - add your own too.
04
Background sync
Configurable auto-sync interval from 30 seconds to 1 hour while minimised to the system tray.
05
Live diagnostics
Per-server status, offset, round-trip time and stratum, with dark and light themes.

How it works

01
Concurrent query
All servers receive NTP v4 requests through a thread pool, capturing offset, delay and stratum.
02
Median offset
Responses with stratum above 4 or errors are dropped; the median of the rest is taken.
03
Apply correction
Current UTC plus the median offset is converted to FILETIME and written with SetSystemTimeAsFileTime.
04
Report accuracy
Displayed as half the average round-trip delay - the theoretical one-way uncertainty.

Running locally

bash
git clone https://github.com/HouwyTwitch/win-time-sync-tool.git
cd win-time-sync-tool
pip install -r requirements.txt

# run elevated to actually set the clock
python main.py