Split Lap Timer - Split Laps, record times.:-) Egg Timer - An Online Sand Timer. Bomb Countdown - Watch the fuse go down. Clock Countdown - It goes round and round. Chess Clock - A free online Chess Clock; Chess Timer - Clock goes UP, Timer goes Down. Online Clock - An Online Clock! Full Screen and Clear. The RZ in-wall timer series is the most versatile heavy-duty timer in the market today. This timer includes sun set and rise astronomic programming, 7-day programming allowing 10 on/off daily settings, random and vacation mode security, daylight savings and leap year compensation, power outage backup, 3-way wiring and zero cross switching. EStopwatch.net provides you with a simple and free stopwatch. Stop looking for devices to measure time — your stopwatch is now just one click away! If you have advanced needs, you can save several measurements while stopping the stopwatch or not.
Fires one or moreActionEvent
s at specified intervals. An example use is an animation object that uses a Timer
as the trigger for drawing its frames. Setting up a timer involves creating a Timer
object, registering one or more action listeners on it, and starting the timer using the start
method. For example, the following code creates and starts a timer that fires an action event once per second (as specified by the first argument to the Timer
constructor). The second argument to the Timer
constructor specifies a listener to receive the timer's action events.
Timers
are constructed by specifying both a delay parameter and an ActionListener
. The delay parameter is used to set both the initial delay and the delay between event firing, in milliseconds. Once the timer has been started, it waits for the initial delay before firing its first ActionEvent
to registered listeners. After this first event, it continues to fire events every time the between-event delay has elapsed, until it is stopped.
After construction, the initial delay and the between-event delay can be changed independently, and additional ActionListeners
may be added.
If you want the timer to fire only the first time and then stop, invoke setRepeats(false)
on the timer.
Although all Timer
s perform their waiting using a single, shared thread (created by the first Timer
object that executes), the action event handlers for Timer
s execute on another thread -- the event-dispatching thread. This means that the action handlers for Timer
s can safely perform operations on Swing components. However, it also means that the handlers must execute quickly to keep the GUI responsive.
In v 1.3, another Timer
class was added to the Java platform: java.util.Timer
. Both it and javax.swing.Timer
provide the same basic functionality, but java.util.Timer
is more general and has more features. The javax.swing.Timer
has two features that can make it a little easier to use with GUIs. First, its event handling metaphor is familiar to GUI programmers and can make dealing with the event-dispatching thread a bit simpler. Second, its automatic thread sharing means that you don't have to take special steps to avoid spawning too many threads. Instead, your timer uses the same thread used to make cursors blink, tool tips appear, and so on.
Timer Countdown
You can find further documentation and several examples of using timers by visiting How to Use Timers, a section in The Java Tutorial. For more examples and help in choosing between this Timer
class and java.util.Timer
, see Using Timers in Swing Applications, an article in The Swing Connection.
Timer Clock
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans
package. Please see XMLEncoder
.