-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstandalone_run100.html
53 lines (48 loc) · 959 Bytes
/
standalone_run100.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
42
43
44
45
46
47
48
49
50
51
52
53
<html>
<body>
<script>
var x = [];
var p = window.performance;
function xx() { run20(); run5(); }
function run100a() { run100();run100(); }
function run100b() { run100();run100(); }
function run100c() { run100();run100(); }
function run100d() { run100();run100(); }
function run5() {
var s = p.now();
var e = 0;
while (e < 5) {
e = p.now() - s;
}
x.push(e);
}
function run20() {
var s = p.now();
var e = 0;
run5();
while (e < 20) {
e = p.now() - s;
}
x.push(e);
}
function run100() {
var s = p.now();
var e = 0;
run20();
while (e < 100) {
e = p.now() - s;
}
x.push(e);
}
// Delay this startup be 1s to make sure that the browser is in
// a stable state.
window.setTimeout(function() {
run100a();
run100b();
run100c();
run100d();
document.body.innerHTML = "Done:" + x.join('-');
}, 1000);
</script>
</body>
</html>