[issue45429] [Windows] time.sleep() should use CREATE_WAITABLE_TIMER_HIGH_RESOLUTION
Benjamin Szőke added the comment: A similar solution was introduced in VirtualBox some months ago. Soon, i could get back my Windows 10 developing PC and i can try this things. https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Runtime/r3/win/timer-win.cpp#L312 -- ___ Python tracker <https://bugs.python.org/issue45429> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45429] [Windows] time.sleep() should use CREATE_WAITABLE_TIMER_HIGH_RESOLUTION
Change by Benjamin Szőke : -- nosy: +Livius ___ Python tracker <https://bugs.python.org/issue45429> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux
Benjamin Szőke added the comment: In other words, using absolute timeout can eliminate the systematic error of desired sleep time. -- ___ Python tracker <https://bugs.python.org/issue21302> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux
Benjamin Szőke added the comment: It is not true that there are no benefits. Absolute timeout using can reduce the overhead time of any variable and object intialization cost before the WaitForMultipleObjects() which will perform the real sleeping via blocking wait in pysleep(). GetSystemTimePreciseAsFileTime() must be call at the first line as much as it can in pysleep(). This is the same implementation in Linux via clock_nanosleep(). So, to using absolute timeout and GetSystemTimePreciseAsFileTime() can improves the accuracy of the desired sleep time. For example if sleep = 2.0 sec then real relative sleep time = 2.001234 sec, but absolute sleep time = 2.12 sec. Benefits are in not the technicaly backgorund, rather it is in the usecase. -- ___ Python tracker <https://bugs.python.org/issue21302> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux
Benjamin Szőke added the comment: Absolute timeout implementation via SetWaitableTimer() and GetSystemTimePreciseAsFileTime() is always better because it can reduce the "waste time" or "overhead time" what is always exist in any simple interval sleep implementation. Moreover, it is the only one which is eqvivalent with clock_nanosleep() implementation of Linux which is now the most state of the art implementation for precise sleeping. So, my opinion is that absolute timeout implementation could be the most modern and sustainable for future python. -- ___ Python tracker <https://bugs.python.org/issue21302> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux
Benjamin Szőke added the comment: https://www.python.org/downloads/windows/ "Note that Python 3.10.0 cannot be used on Windows 7 or earlier." vstinner: Is it true that Windows 7 is not supported OS anymore? In this case we do not need to care about Windows 7 and earlier Windows OS compatibility and it is time to use nicely GetSystemTimePreciseAsFileTime() in time.time() and time.sleep() as absolute sleeping because it is available since Windows 8. -- ___ Python tracker <https://bugs.python.org/issue21302> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux
Benjamin Szőke added the comment: Do you have any information about when will be it released in 3.11? -- ___ Python tracker <https://bugs.python.org/issue21302> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux
Change by Benjamin Szőke : -- pull_requests: +26917 pull_request: https://github.com/python/cpython/pull/28526 ___ Python tracker <https://bugs.python.org/issue21302> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux
Change by Benjamin Szőke : -- pull_requests: +26754 pull_request: https://github.com/python/cpython/pull/28341 ___ Python tracker <https://bugs.python.org/issue21302> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux
Benjamin Szőke added the comment: Can you review my final implementation? https://github.com/python/cpython/pull/28111 -- versions: +Python 3.11 ___ Python tracker <https://bugs.python.org/issue21302> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux
Change by Benjamin Szőke : -- nosy: +Livius nosy_count: 5.0 -> 6.0 pull_requests: +26552 pull_request: https://github.com/python/cpython/pull/28111 ___ Python tracker <https://bugs.python.org/issue21302> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com