Skip to content

Commit 0ab3083

Browse files
committed
differ the settimeout function
1 parent 6edfb62 commit 0ab3083

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

blockmainthrd.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
console.log("Started");
22

3-
setTimeout(function()
3+
function cb()
44
{
55
console.log("After 5 sec");
6-
}, 5000);
6+
}
7+
setTimeout(cb, 0);
78

89
console.log("Ended");
910

0 commit comments

Comments
 (0)