!7
html {
ret htitle("Web Worker-Less Calc Test")
+ hbody(
p("Count numbers: " + hfulltag("output", "", id := "result"))
+ hjavascript([[
var startTime, i = 0;
function go() {
if (!startTime) startTime = new Date();
while (true) {
i = i+1;
if ((i % 1000000) == 0) {
var ms = new Date()-startTime;
var mips = (i/ms/1000).toFixed(2);
document.getElementById("result").innerHTML = "Counted to: " + i + " in " + ms + " ms ("
+ mips + " million steps/s)";
setTimeout(go, 0);
break;
}
}
}
]]).replace("$LINK", jsQuote(relativeRawBotLink(programID(), "worker.js"))), onLoad := "go()");
}