forked from sakopqiu/fe_misc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample3.html
More file actions
28 lines (27 loc) · 1011 Bytes
/
example3.html
File metadata and controls
28 lines (27 loc) · 1011 Bytes
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
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<script>
console.log("Here domLoading is " + performance.timing.domLoading);
console.log("Here domInteractive should be 0-> " + performance.timing.domInteractive);
let total = 10;
for(let i = 0;i < 100000;i++){
total += Math.random() / Math.cos(Math.random());
}
console.log("Total is " + total);
window.onload = ()=>{
console.log("after window.onload");
console.log("Here domLoading is " + performance.timing.domLoading);
console.log("Here domInteractive is " + performance.timing.domInteractive);
console.log("It took " + (performance.timing.domInteractive - performance.timing.domLoading)
+ "ms to build DOM tree");
}
</script>
</body>
</html>