Chris Angelico <ros...@gmail.com> writes: > On Thu, 3 Feb 2022 at 09:33, Barry <ba...@barrys-emacs.org> wrote: > (Side point: The OP's code is quite inefficient, as it creates a new > thread for each reiteration, but there's nothing wrong with that if > you're looking for something simple.)
It is just something I wrote fast. How could I do this in a better way? > (regardless of your OS). The same could be done with this timer; an > __exit__ method would make a lot of sense here, and would allow the > timer to be used in a with block to govern its execution. (It also > isn't really necessary, but if you want a good Pythonic way to show > the beginning and end of its use area, a 'with' block is the way to > go.) I will look into that. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list