Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Timers make it easy to delay the execution of a function. Simply set up a timer that fires only once, and set the delay for the time you'd like to wait before firing. A common application for this is creating a timeout, a predetermined time allotted for an action to take place, such as a server response, after which the action is aborted.
In Example 22-5, you'll use a timer to create something you're no doubt familiar with from browsing the internet, a redirect script. First you'll create the Redirect class, which will handle the timer and navigation. Then you'll set up an example class to test it.