Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

set timeout javascript

function timeout(ms) {
    return new Promise(resolve => setTimeout(resolve, ms));
}
async function sleep(fn, ...args) {
    await timeout(3000);
    return fn(...args);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #set #timeout #javascript
ADD COMMENT
Topic
Name
6+2 =