win-precise-time
What it is and what it does
win-precise-time is a Windows-only C extension that provides microsecond-resolution time measurement and sub-millisecond sleep precision, addressing a Windows-specific limitation where the builtin time.time() offers only ~15ms resolution. The package exposes two main functions: time() retrieves the current timestamp using GetSystemTimePreciseAsFileTime, and sleep() implements a more precise sleep by using SetWaitableTimerEx without requiring system-wide timer resolution changes. Both functions are implemented in C and perform comparably to the builtin time.perf_counter(). The package has no runtime dependencies and supports Python 3.7 through current versions on both 32-bit and 64-bit Windows.
The package is useful for Windows developers who need accurate timing for benchmarking, performance profiling, or real-time applications where millisecond-level jitter is unacceptable. It is production-stable but dormant; the last release was 2023-10-08 and the repository shows no active development, though it remains unarchived and free of known security vulnerabilities.
Use it for:
- Benchmarking and profiling Windows applications where builtin time.time() resolution is insufficient.
- Real-time or latency-sensitive applications requiring sub-millisecond sleep precision without global timer changes.
- Performance testing frameworks that need accurate microsecond-level timing on Windows.
- Game engines or multimedia applications on Windows requiring precise frame timing.
- Replacing time.time() and time.sleep() in code when running on Windows to avoid precision loss.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides high-resolution time measurement and sub-millisecond sleep on Windows by wrapping Windows API calls, replacing the ~15ms resolution of the builtin time.time().
Yes, if you are on Windows and need microsecond-resolution timing or sub-millisecond sleep precision. The package is stable, permissively licensed, and has no known vulnerabilities. However, expect no active maintenance or updates; dormant status means community support is limited. Not applicable on non-Windows platforms.
Install
win-precise-time on PyPI
pip
pip install win-precise-timeuv
uv add win-precise-timepoetry
poetry add win-precise-timeInstalling win-precise-time
Before you install
Medium friction: platform-specific compiled wheels for Windows only (cp37–cp312, win32 and win_amd64). Dormant maintenance (last release 2023-10-08, last commit 2024-10-09); no active development but repository not archived.
License in practice
MIT license (permissive); no restrictions on commercial or private use, modification, or distribution provided the license text is retained.
Quickstart
pip install win-precise-time
import win_precise_time as wpt
wpt.time() # retrieve current time with high precision
wpt.sleep(0.001) # sleep for 1ms with sub-millisecond precision
Windows-only; requires Python 3.7 or later and a Windows OS (wheels provided for win32 and win_amd64 only).
Verify before relying
- Whether the package works reliably on all supported Python versions given dormant maintenance status.
- Real-world precision guarantees under different system loads or timer configurations.
- Compatibility with Windows Server editions or non-standard Windows configurations.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 1,041 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 184,628/month — #10,029 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: win_precise_time-1.4.2-cp310-cp310-win32.whl; win_precise_time-1.4.2-cp310-cp310-win_amd64.whl; win_precise_time-1.4.2-cp311-cp311-win32.whl; win_precise_time-1.4.2-cp311-cp311-win_amd64.whl; win_precise_time-1.4.2-cp312-cp312-win32.whl; win_precise_time-1.4.2-cp312-cp312-win_amd64.whl; win_precise_time-1.4.2-cp37-cp37m-win32.whl; win_precise_time-1.4.2-cp37-cp37m-win_amd64.whl; win_precise_time-1.4.2-cp38-cp38-win32.whl; win_precise_time-1.4.2-cp38-cp38-win_amd64.whl; win_precise_time-1.4.2-cp39-cp39-win32.whl; win_precise_time-1.4.2-cp39-cp39-win_amd64.whl
Keywords: Windows, time, sleep, GetSystemTimePreciseAsFileTime, SetWaitableTimerEx, CREATE_WAITABLE_TIMER_HIGH_RESOLUTION
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
stopwatch.pyProvides a simple stopwatch timer that measures…
permissive · top 15,000 on PyPI
python-timeoutGenerates random timeouts between specified…
unclear · top 15,000 on PyPI
win32-setctimeSets file creation time on Windows systems via…
permissive · top 5,000 on PyPI
uiautomationAutomates Windows UI controls and windows by…
permissive · top 15,000 on PyPI
ntstatusProvides Python constants and lookup methods…
permissive · top 15,000 on PyPI
nanotimeNanotime provides a 64-bit UNIX timestamp type…
permissive · top 15,000 on PyPI
recognizers-text-date-timeRecognizes and resolves date and time entities…
permissive · top 15,000 on PyPI
codetimingMeasures elapsed time in Python code using a…
permissive · top 5,000 on PyPI
monotonicProvides a monotonic clock function that…
permissive · top 5,000 on PyPI
about-timeMeasures execution time and throughput of code…
permissive · top 5,000 on PyPI