Popular recipes by James Stroud http://code.activestate.com/recipes/users/2658888/2005-12-18T22:24:29-08:00ActiveState Code RecipesResettable Timer Class (Python)
2005-12-18T22:24:29-08:00James Stroudhttp://code.activestate.com/recipes/users/2658888/http://code.activestate.com/recipes/464959-resettable-timer-class/
<p style="color: grey">
Python
recipe 464959
by <a href="/recipes/users/2658888/">James Stroud</a>
(<a href="/recipes/tags/threads/">threads</a>).
Revision 6.
</p>
<p>The ResettableTimer class is a timer whose counting loop can be reset arbitrarily. Its duration is configurable. Commands can be specified for both expiration and update. Its update resolution can also be specified. Resettable timer keeps counting until the "run" method is explicitly killed with the "kill" method.</p>