public abstract class

Timer

extends Object
java.lang.Object
   ↳ com.google.gwt.user.client.Timer

Class Overview

A simplified, browser-safe timer class. This class serves the same purpose as java.util.Timer, but is simplified because of the single-threaded environment. To schedule a timer, simply create a subclass of it (overriding run()) and call schedule(int) or scheduleRepeating(int).

Example

{@example com.google.gwt.examples.TimerExample}

Summary

Public Constructors
Timer()
Public Methods
void cancel()
Cancels this timer.
abstract void run()
This method will be called when a timer fires.
void schedule(int delayMillis)
Schedules a timer to elapse in the future.
void scheduleRepeating(int periodMillis)
Schedules a timer that elapses repeatedly.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Timer ()

Public Methods

public void cancel ()

Cancels this timer.

public abstract void run ()

This method will be called when a timer fires. Override it to implement the timer's logic.

public void schedule (int delayMillis)

Schedules a timer to elapse in the future.

Parameters
delayMillis how long to wait before the timer elapses, in milliseconds

public void scheduleRepeating (int periodMillis)

Schedules a timer that elapses repeatedly.

Parameters
periodMillis how long to wait before the timer elapses, in milliseconds, between each repetition