Window Object
The setTimeout() method calls a function or evaluates an expression after a specified number of milliseconds.
Tip: 1000 ms = 1 second.
| Parameter | Description |
|---|---|
| code | Required. The function that will be executed |
| millisec | Required. The number of milliseconds to wait before executing the code |
| lang | Optional. The scripting language: JScript | VBScript | JavaScript |
![]()
The setTimeout() method is supported in all major browsers.
Display an alert box after 3 seconds:
Count forever - with a Stop button
A clock created with timing events
Window Object
Your message has been sent to W3Schools.