summaryrefslogtreecommitdiff
path: root/test/js/settimeout.html
blob: 1755973c6d5e737d70a8211d5ac2986ebea7ac23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<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>