This repository has been archived by the owner on Apr 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
bench.html
42 lines (42 loc) · 1.43 KB
/
bench.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
<!doctype html>
<html>
<head>
<title>benchmark</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta names="apple-mobile-web-app-status-bar-style" content="black"/>
<meta http-equiv="content-language" content="en-US"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<!--[if IE 8]><script src="build/ie8.max.js"></script><![endif]-->
<style type="text/css">
div {
font-family: sans-serif;
font-size: 16px;
cursor: default;
}
</style>
<script>
this.onload = function () {
var div = document.getElementsByTagName('div')[0],
type = 'x:increment',
times = 0,
start;
function dispatch(){
var e = document.createEvent('Event');
e.initEvent(type, true, true);
div.dispatchEvent(e);
}
function increment(e) {
times++;
}
div.addEventListener(type, increment);
start = (new Date).getTime();
while((new Date).getTime() - start < 1000) dispatch();
div.innerHTML = 'Dispatched about ' + times + ' times per second.';
};
</script>
</head>
<body>
<div></div>
</body>
</html>