JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Using the Timer Class

As discussed in the In Depth section of this chapter, timers are components that cause periodic Tick events that you can use to execute code at specific intervals. Here is the class hierarchy of this component:

Object
   MarshalByRefObject
      Component
         Timer

You can find the more notable public properties of the Timer class in Table 8.21, the more notable methods in Table 8.22, and the more notable events in Table 8.23.

Table 8.21: Noteworthy public properties of Timer objects.

Property

Means

Enabled

Gets/sets whether the timer is running.

Interval

Gets/sets the time (in milliseconds) between timer ticks.

Table 8.22: Noteworthy public methods of Timer objects.

Method

Means

Start

Starts the timer.

Stop

Stops the timer.

Table 8.23: Noteworthy public events of Timer objects.

Event

Means

Tick

Occurs when the timer interval has elapsed (and the timer is enabled).

Previous Section Next Section




JavaScript Editor Free JavaScript Editor     JavaScript Editor