Home / Javascript Tips Generated By ChatGPT / Using setTimeout for Delayed Execution in Javascript setTimeout executes a function once after a specified time. Source Code setTimeout(() => console.log('Hello after 2 seconds'), 2000);