Created
January 28, 2011 23:47
-
-
Save markandey/801261 to your computer and use it in GitHub Desktop.
A quick & simple test to show you which browser is faster
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title>DOM + JavaScript Test</title> | |
</head> | |
<script> | |
var count=0; | |
var stop=true; | |
function testfun(){ | |
document.getElementById("count").innerHTML=""+Math.sqrt(count); | |
ID=count%100; | |
document.getElementById("ID"+ID).innerHTML="-<div id=\"ID"+(ID+1)+"\">testnode</div>"; | |
count++; | |
if(!stop){ | |
setTimeout(testfun,1); | |
} | |
} | |
function startTest(){ | |
stop=!stop; | |
setTimeout(testfun,1); | |
} | |
</script> | |
<body> | |
<div id="doc" > | |
<div id="hd" role="banner"><h1>DOM + JavaScript Test</h1></div> | |
<div id="bd" role="main"> | |
<button onclick="startTest();">Click me to start</button> | |
<div id="count"></div> | |
<div id="ID0"> | |
</div> | |
<div id="ft" role="contentinfo"><p>by:<a href="http://www.markandey.com">markandey</a></p></div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment