-
Notifications
You must be signed in to change notification settings - Fork 7
/
flops.html
45 lines (41 loc) · 1.09 KB
/
flops.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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>javascript flops</title>
</head>
<body>
<h1>javascript flops</h1>
<p>A port of a simple old C port of a simple old FORTRAN program that benchmarks how fast a CPU can do math (FLOating Point Operations per Second).</p>
<div id="flops-out" style="display: none;"></div>
<form>
<textarea name="results" rows="20" cols="80"></textarea><br />
</form>
<script src="flops.js"></script>
<script>
function printf(opt_vararg) {
if (!opt_vararg) {
return;
}
var outl = document.getElementsByTagName('textarea');
if (outl && outl.length) {
var out = outl.item(0);
if (out) {
out.innerHTML = out.innerHTML + opt_vararg;
}
}
var out = document.getElementById('flops-out');
if (out) {
var newe = document.createElement('div');
newe.style.fontFamily = 'monospace';
newe.appendChild(document.createTextNode(opt_vararg));
out.appendChild(newe);
}
};
//printf("running flops");
flops_main();
(function(){
// TODO: print browser stats here
})();
</script>
</body>
</html>