{"id":22984,"library":"win-precise-time","title":"win-precise-time","description":"Windows-only library providing precise time measurement and sleep functions using high-resolution performance counters and multimedia timers. At version 1.4.2, it supports Python >=3.7 and is actively maintained.","status":"active","version":"1.4.2","language":"python","source_language":"en","source_url":"https://github.com/zariiii9003/win-precise-time","tags":["windows","time","high-resolution","sleep","performance"],"install":[{"cmd":"pip install win-precise-time","lang":"bash","label":"Default"}],"dependencies":[],"imports":[{"note":"Function for high-resolution sleep using multimedia timers.","symbol":"precise_sleep","correct":"from win_precise_time import precise_sleep"}],"quickstart":{"code":"from win_precise_time import precise_sleep, precise_time\nimport os\nif os.name != 'nt':\n    print('This library is Windows-only.')\n    exit()\nt = precise_time()\nprint(f'Start time: {t}')\nprecise_sleep(0.001)\nprint(f'Elapsed: {precise_time() - t}')","lang":"python","description":"Demonstrates precise time measurement and sleep."},"warnings":[{"fix":"Guard imports with platform checks.","message":"Only works on Windows; raises ImportError on other platforms.","severity":"breaking","affected_versions":"all"},{"fix":"Use threading or subprocess if interruptibility required.","message":"precise_sleep() blocks the calling thread; cannot be interrupted by signals.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Wrap import: if os.name == 'nt': from win_precise_time import ...","cause":"Attempting to import on non-Windows OS.","error":"ImportError: No module named 'win_precise_time'"},{"fix":"Use correct function name: precise_sleep (all lowercase).","cause":"Typo in function name (case-sensitive).","error":"AttributeError: module 'win_precise_time' has no attribute 'precise_sleep'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}