How to delay until a next increment of time occurs ?
Barry Scott
barry at barrys-emacs.org
Sun Nov 17 13:30:46 EST 2019
> On 13 Nov 2019, at 22:36, Dietmar Schwertberger <maillist at schwertberger.de> wrote:
>
> On 13.11.2019 23:20, Dennis Lee Bieber wrote:
>> For Windows it may require coding a busy-wait sleep function using the
>> high-performance counter and computing a counter value (modulo?) on which
>> to exit the loop.
> time.perf_counter() is using this on Windows. I'm just worried about floating point limitations on older Python versions.
>
> From Python 3.7 onwards, there's time.perf_counter_ns(), but even then it would be nice if it was just possible to reset the perf_counter.
Reseting things like timers is often a problem.
What if there are two pieces of code using the value of the perf_counter?
If one use resets the timer then the other user will be broken.
Barry
>
> Regards,
>
> Dietmar
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
More information about the Python-list
mailing list