Skip to content

Instantly share code, notes, and snippets.

@msarchet
Created November 16, 2011 22:04
Show Gist options
  • Save msarchet/1371605 to your computer and use it in GitHub Desktop.
Save msarchet/1371605 to your computer and use it in GitHub Desktop.
Count super fast
<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