Mercurial > projects > dwt-addons
view dwtx/dwtxhelper/TimerTask.d @ 187:293a2f22f944
Add Collection impl
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 26 Oct 2008 14:04:17 +0100 |
parents | 987b95661bb9 |
children |
line wrap: on
line source
module dwtx.dwtxhelper.TimerTask; import tango.time.Time; import dwt.dwthelper.utils; import dwt.dwthelper.Runnable; import dwtx.dwtxhelper.Timer; class TimerTask : Runnable { package long scheduled; package long lastExecutionTime; package long period; package bool fixed; this(){ this.scheduled = 0; this.lastExecutionTime = -1; } bool cancel(){ bool prevented_execution = (this.scheduled >= 0); this.scheduled = -1; return prevented_execution; } abstract void run(); long scheduledExcecutionTime(){ return lastExecutionTime; } }