forked from xueduany/KitJs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patht.html
More file actions
47 lines (46 loc) · 1.12 KB
/
t.html
File metadata and controls
47 lines (46 loc) · 1.12 KB
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
<html>
<link rel="stylesheet" href="a.css" />
</head>
<body>
<div id="c" style="background-color: black">123</div>
<script>
//console.log(document.getElementById('c').offsetHeight);
//document.getElementById('c').style.height = '1px';
//console.log(document.getElementById('c').offsetHeight);
//setTimeout(function() {
//document.getElementById('c').style.height = 'auto';
//console.log(document.getElementById('c').offsetHeight);
//}, 0);
function aa(b) {
var d1 = new Date().getTime();
b();
var d2 = new Date().getTime();
console.log((d2 - d1) / 1000);
}
/*
c1 = new Date().getTime();
setInterval(function() {
c2 = new Date().getTime();
console.log((c2 - c1) / 1000)
c1 = c2;
aa(function() {
for ( var i = 0; i < 100000; i++) {
console.log(1);
}
});
}, 5000);
*/
c1 = new Date().getTime();
setTimeout(function() {
c2 = new Date().getTime();
console.log((c2 - c1) / 1000)
c1 = c2;
}, 1000);
aa(function() {
for ( var i = 0; i < 100000; i++) {
console.log(1);
}
});
</script>
</body>
</html>