Print string "Shreyas" and wait for 10 seconds. The total duration between 3 attempts doesn't exceed 10 seconds.
Script var timeout = 3000; // 3 seconds function printWithTimeout(str, timeout) { setTimeout(function() { console.log(str); }, timeout); } printWithTimeout("Shreyas", timeout); printWithTimeout("Shreyas", timeout); printWithTimeout("Shreyas", timeout);