Skip to content

This is a Python implementation of the Java Timer/TimerTask classes

Notifications You must be signed in to change notification settings

nickc92/Python-Timer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Python-Timer

I always liked the Java Timer/TimerTask classes, and found them to be a useful pattern in many applications. Python seems to lack something quite like this, so I implemented something simple in Python to do basically the same thing.

import Timer, time

timer = Timer.Timer()
class MyTask(Timer.TimerTask):
    def run(self):
    print 'task running; current time is %.3f'%(time.time())

task = MyTask()
timer.schedulePeriodic(task, 1.0)
time.sleep(10.0)

About

This is a Python implementation of the Java Timer/TimerTask classes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages