Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  <div id="o"></div>
  <button id="stop">Stop</button>
</body>
</html>
 
var timer = document.querySelector('#o');
var calls = 0;
var start = +new Date;
setInterval(function () {
  if (window.stopTimer) { return; }
    var time = (new Date - start) / 1000;
    var avg  = ++calls / time;
    timer.textContent = 
       calls + " calls in " + time.toFixed(3) + "s is " + avg.toFixed(6) + " calls/second";
}, 10);
document.querySelector('#stop').onclick = function() {
  window.stopTimer = true;
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers