Created
November 16, 2011 22:04
-
-
Save msarchet/1371605 to your computer and use it in GitHub Desktop.
Count super fast
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<script type="text/javascript"> | |
function countToFiveBillion(counter, num){ | |
if(num < 5000000000) | |
{ | |
num++; | |
if(num % 18700 == 0){ | |
counter.innerHTML = num; | |
setTimeout(function() {countToFiveBillion(counter, num)}, 1); | |
} else { | |
countToFiveBillion(counter, num); | |
} | |
} else { | |
count.innerHTML = "number greater than 5 Billion"; | |
} | |
} | |
function initiateCountDown() | |
{ | |
var counter = document.getElementById("counter"); | |
var num = +counter.innerHTML; | |
countToFiveBillion(counter, num); | |
} | |
</script> | |
<body onload="initiateCountDown();"> | |
<div id="counter">0</div> | |
</body> | |
</html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment