Skip to content

Instantly share code, notes, and snippets.

@Drakekin
Forked from anonymous/index.html
Last active August 29, 2015 14:19
Show Gist options
  • Select an option

  • Save Drakekin/3bebfc38930e13f0fb37 to your computer and use it in GitHub Desktop.

Select an option

Save Drakekin/3bebfc38930e13f0fb37 to your computer and use it in GitHub Desktop.
http://jsbin.com/soneyefeye/4/edit?html,js,output <- go here to see what this code actually does
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div id="foo"></div>
<script id="jsbin-javascript">
function dom_block() {
var div, start;
div = document.getElementById("foo");
for (var i = 10; i > 0; i--) {
div.innerHTML = i;
start = +new Date;
while (+new Date < start + 1000) {
// noprotect
}
}
div.innerHTML = "Done!";
}
dom_block();
</script>
<script id="jsbin-source-javascript" type="text/javascript">function dom_block() {
var div, start;
div = document.getElementById("foo");
for (var i = 10; i > 0; i--) {
div.innerHTML = i;
start = +new Date;
while (+new Date < start + 1000) {
// noprotect
}
}
div.innerHTML = "Done!";
}
dom_block();</script></body>
</html>
function dom_block() {
var div, start;
div = document.getElementById("foo");
for (var i = 10; i > 0; i--) {
div.innerHTML = i;
start = +new Date;
while (+new Date < start + 1000) {
// noprotect
}
}
div.innerHTML = "Done!";
}
dom_block();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment