Waht do you think about my repeated_timer class

Cecil Westerhof Cecil at decebal.nl
Wed Feb 2 19:27:07 EST 2022


Chris Angelico <rosuav at gmail.com> writes:

> On Thu, 3 Feb 2022 at 09:33, Barry <barry at 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


More information about the Python-list mailing list