-
Notifications
You must be signed in to change notification settings - Fork 2
/
coremark-minimal.html
39 lines (32 loc) · 962 Bytes
/
coremark-minimal.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
<html>
<head>
<style>
body {
font-family: 'Courier New', monospace;
background-color: #222;
color: white;
}
</style>
<script>
async function runCoreMark() {
function log(x) { document.querySelector("#log").innerHTML += (x + "<br/>"); }
function delay(ms) { return new Promise(res => setTimeout(res, ms)); }
log("Loading WebAssembly...");
const response = await fetch('coremark-minimal.wasm');
const buffer = await response.arrayBuffer();
const res = await WebAssembly.instantiate(buffer, {
env: {
clock_ms: () => BigInt(Date.now())
}
});
log("Running CoreMark 1.0... [should take 12..20 seconds]");
await delay(100);
const result = res.instance.exports.run();
log("Result: " + result.toFixed(3));
}
</script>
</head>
<body onload="runCoreMark()">
<div id="log"/>
</body>
</html>