How to delay until a next increment of time occurs ?
David Raymond
David.Raymond at tomtom.com
Wed Nov 13 11:31:48 EST 2019
Maybe something along the lines of this?
timeInterval = 0.0003
time.sleep(timeInterval - (time.perf_counter() % timeInterval))
-----Original Message-----
From: Python-list <python-list-bounces+david.raymond=tomtom.com at python.org> On Behalf Of R.Wieser
Sent: Wednesday, November 13, 2019 11:12 AM
To: python-list at python.org
Subject: Re: How to delay until a next increment of time occurs ?
Skip,
> Take a look at threading.Timer.
Thanks. It seems to solve the problem by calling it at the start of the
executed code (instead of the end), but costs thread usage ...
Regards,
Rudy Wieser
--
https://mail.python.org/mailman/listinfo/python-list
More information about the Python-list
mailing list