skillfed

win-precise-time

win-precise-time v1.4.2 184.6K downloads/30d#10,029 on PyPI7
Permissive license MIT DORMANT released

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-time

uv

uv add win-precise-time

poetry

poetry add win-precise-time

Installing 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

Development Status :: 5 - Production/StableProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: Implementation :: CPython

Tags

windows high resolution timerprecise sleep windowssub-millisecond sleepwindows time accuracygetsystemtimepreciseasfiletimequeryperformancecounter wrapperwindows timer precision
windows-onlytiming-precisionc-extension

More Utilities packages