-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
63 lines (60 loc) · 1.51 KB
/
index.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
54
55
56
57
58
59
60
61
62
63
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
rel="shortcut icon"
href="https://millionjs.org/favicon.svg"
type="image/svg+xml"
/>
<style>
.hidden {
display: none !important;
}
.w-full {
width: 100% !important;
}
.text-center {
text-align: center !important;
}
.flex {
display: flex !important;
}
.justify-center {
justify-content: center !important;
}
td {
padding: 0.1rem 0.5rem;
}
</style>
<title>Million.js Demo</title>
<script
src="https://cdn.jsdelivr.net/npm/perf-monitor@0.6.0/dist/component.js"
type="module"
></script>
<script type="module">
import {
ema,
emaPush,
} from 'https://cdn.jsdelivr.net/npm/perf-monitor@0.6.0/dist/index.js';
const testEMA = ema();
document.querySelector('perf-monitor').observe('test', testEMA);
function tick() {
let t0 = performance.now();
for (let i = 0; i < 100000; i++) {
Math.random();
}
emaPush(testEMA, performance.now() - t0);
setTimeout(tick, 30);
}
tick();
</script>
</head>
<body>
<perf-monitor fps mem></perf-monitor>
<div id="root"></div>
<script type="module" src="./src/index.jsx"></script>
</body>
</html>