Package lejos.utility
Class Timer
- java.lang.Object
-
- lejos.utility.Timer
-
public class Timer extends java.lang.ObjectTimer object, with some similar functionality to java.Swing.Timer.- Author:
- Ryan VanderBijl
-
-
Constructor Summary
Constructors Constructor Description Timer(int theDelay, TimerListener el)Create a Timer object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetDelay()access how man milliseconds between timedOut() messages.voidsetDelay(int newDelay)Change the delay between timedOut messages.voidstart()Starts the timer, telling it to send timeOut() methods to the TimerListener.voidstop()Stops the timer.
-
-
-
Constructor Detail
-
Timer
public Timer(int theDelay, TimerListener el)Create a Timer object. Every theDelay milliseconds the el.timedOut() function is called. You may change the delay with setDelay(int). You need to call start() explicitly.
-
-
Method Detail
-
getDelay
public int getDelay()
access how man milliseconds between timedOut() messages.
-
setDelay
public void setDelay(int newDelay)
Change the delay between timedOut messages. Safe to call while start()ed. Time in milli-seconds.
-
stop
public void stop()
Stops the timer. timedOut() messages are not sent.
-
start
public void start()
Starts the timer, telling it to send timeOut() methods to the TimerListener.
-
-