Source Code:
(back to article)
<!DOCTYPE html> <html> <head> <title>Title of the Document</title> </head> <body> <div id="divId"></div> <script> let t = 0; function count() { // do some hard work do { t++; divId.innerHTML = t; } while (t % 1e3 != 0); if(t < 1e6) { queueMicrotask(count); } } count(); </script> </body> </html>
Result:
Report an issue