forked from aFarkas/html5shiv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathperf.1.html
41 lines (36 loc) · 1.63 KB
/
perf.1.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>HTML5 Shiv</title>
<link rel="stylesheet" href="style.css">
<script src="../src/html5shiv-printshiv.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.js"></script>
</head>
<body>
<div id="time"></div>
<section>This sentence is in a green box <mark>with these words highlighted</mark>.</section>
<script>
function addDom(){
var div, frag, fragDiv, divFrag, divFragDiv;
div = document.createElement('div');
div.innerHTML = '<section>This native javascript sentence is in a green box <mark>with these words highlighted</mark>?</section>';
frag = document.createDocumentFragment();
frag.appendChild(div);
div.innerHTML += '<section>This native javascript sentence is also in a green box <mark>with these words highlighted</mark>?</section>';
document.body.appendChild(frag);
frag = document.createDocumentFragment();
fragDiv = frag.appendChild(document.createElement('div'));
fragDiv.innerHTML = '<section>This native javascript sentence is in a green box <mark>with these words highlighted</mark>?</section>';
document.body.appendChild(fragDiv);
jQuery(document.body).append('<section>This jQuery 1.6.4 sentence is in a green box <mark>with these words highlighted</mark>?</section><section>This jQuery 1.6.4 sentence is in a green box <mark>with these words highlighted</mark>?</section>');
}
var time = document.getElementById('time');
var cur = new Date().getTime();
for(var i = 0; i < 1000; i++){
addDom();
}
time.innerHTML = new Date().getTime() - cur;
</script>
<body>
</html>