No summary available
Project Links
Meta
Author: Artur Drogunow
Requires Python: >=3.7
Classifiers
Development Status
- 5 - Production/Stable
Programming Language
- Python
- Python :: 3
- Python :: Implementation :: CPython
win-precise-time
The documentation is available here.
Table of Contents
Description
On Windows the builtin time.time() provides a timestamp with ~15ms resolution.
This package provides the function win_precise_time.time() to retrieve an accurate timestamp by using
GetSystemTimePreciseAsFileTime.
The function is implemented as a C extension so the performance is equal to the builtin time.perf_counter()
(both functions rely on QueryPerformanceCounter).
The function win_precise_time.sleep() reimplements the more precise time.sleep() version of CPython >= 3.11 for older python versions.
This enables sub-millisecond sleep precision without increasing the Windows timer resolution via timeBeginPeriod.
Installation
pip install win-precise-time
Usage
>>> import win_precise_time as wpt
>>> wpt.time() # retrieve current time
1654539449.4548845
>>> wpt.sleep(0.001) # sleep for 1ms
Test
pip install tox
tox
Build
pip install build
python -m build .
License
win-precise-time is distributed under the terms of the MIT license.
1.4.2
Oct 08, 2023
1.4.1
Jan 03, 2023
1.4.0
Oct 08, 2022
1.3.1
Sep 19, 2022
1.3.0
Sep 16, 2022
1.2.0
Sep 09, 2022
1.1.0
Jun 27, 2022
1.0.3
Jun 07, 2022
Wheel compatibility matrix
Files in release
win-precise-time-1.4.2.tar.gz (7.8KiB)
win_precise_time-1.4.2-cp310-cp310-win32.whl (14.4KiB)
win_precise_time-1.4.2-cp310-cp310-win_amd64.whl (14.6KiB)
win_precise_time-1.4.2-cp311-cp311-win32.whl (14.4KiB)
win_precise_time-1.4.2-cp311-cp311-win_amd64.whl (14.6KiB)
win_precise_time-1.4.2-cp312-cp312-win32.whl (14.3KiB)
win_precise_time-1.4.2-cp312-cp312-win_amd64.whl (14.6KiB)
win_precise_time-1.4.2-cp37-cp37m-win32.whl (14.4KiB)
win_precise_time-1.4.2-cp37-cp37m-win_amd64.whl (14.6KiB)
win_precise_time-1.4.2-cp38-cp38-win32.whl (14.4KiB)
win_precise_time-1.4.2-cp38-cp38-win_amd64.whl (14.6KiB)
win_precise_time-1.4.2-cp39-cp39-win32.whl (14.4KiB)
win_precise_time-1.4.2-cp39-cp39-win_amd64.whl (14.6KiB)
No dependencies