Created
September 22, 2013 12:22
-
-
Save otiai10/6659402 to your computer and use it in GitHub Desktop.
overheading for HTMLDOM to jQueryObj
This file contains hidden or 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> | |
<head> | |
<meta charset="utf-8"> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script> | |
<script> | |
var samples = { | |
1 : 1000, | |
2 : 5000, | |
3 : 10000, | |
4 : 20000, | |
5 : 40000, | |
6 : 80000, | |
7 : 160000, | |
8 : 320000, | |
9 : 640000, | |
10 : 1280000 | |
}; | |
var render = function(count, before, after){ | |
var str = '<tr><td>' + count + '</td><td>' + (after - before) + '</td></tr>'; | |
$('#result').append(str); | |
} | |
$(function(){ | |
for(var k in samples){ | |
var sample = samples[k]; | |
var i = 0, | |
before = Date.now(), | |
after = null; | |
while(i<sample){ | |
$('div'); | |
i++; | |
if(i == sample - 1){ | |
after = Date.now(); | |
render(sample, before, after); | |
} | |
} | |
} | |
}); | |
</script> | |
</head> | |
<body> | |
<div id="test"> | |
<p>test</p> | |
</div> | |
<table id="result"> | |
<tr><th>回数</th><th>時間(msec)</th></tr> | |
</table> | |
</body> | |
</head> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
result