Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Example of use of requestAnimationFrame</title>
</head>
<body>
  <p> Look at the JavaScript code inside this page (or look at the JavaScript tab in JsBin)</p>
</body>
</html>
 
window.onload = function init() {
   requestAnimationFrame(mainloop);
};  
function mainloop(timestamp) {
   document.body.innerHTML += "*";
  
   // call back itself every 60th of second
   requestAnimationFrame(mainloop);
}
Output

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

Dismiss x
public
Bin info
MichelBuffapro
0viewers