You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
netsurf/test/js/settimeout.html

18 lines
476 B

<html>
<head>
<title>setTimeout and setInterval</title>
<script>
var counter = 0;
var interval_handle = setInterval(function() {
console.log("Called back ", counter, " times");
counter = counter + 1;
}, 100);
setTimeout(function() {clearInterval(interval_handle);}, 10000);
</script>
</head>
<body>
Check the log, it should be printing a callback indicator for ten
seconds and then stop.
</body>
</html>