-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
35 lines (25 loc) · 1 KB
/
test.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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Test</title>
</head>
<body>
<h1>Test case</h1>
<p>We'll measure time to create 1000 DOM elements</p>
<script type="text/javascript" charset="utf-8" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<!-- Don't forget to add zepto.min.js -->
<!-- <script src="zepto.min.js" type="text/javascript" charset="utf-8"></script> -->
<script src="jquery.profiler.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
console.time('Creating DOM elements');
for(var i = 0; i < 1000; i++) {
newElement = console.lasts(function(){ return $('<div class="element'+i+'">This is ' + i + 'th element</div>') }, 'Create element');
$(document.body).append(newElement);
}
console.timeEnd('Creating DOM elements');
});
</script>
</body>
</html>