To delay a function until a desired amount of time, expressed in milliseconds, elapses use the setTimeout() method: -