Add time it takes to arrive to preRun to test page

This commit is contained in:
Motin 2021-02-15 11:30:45 +02:00
parent 49ad6514ae
commit 77f39545f3

View File

@ -141,13 +141,15 @@ the sky is blue
document.querySelector("#log").value += message + "\n";
}
const start = Date.now();
let moduleLoadStart;
var Module = {
preRun: [function() {
log(`Time until Module.preRun: ${(Date.now() - start)/1000} secs`);
moduleLoadStart = Date.now();
}],
onRuntimeInitialized: function() {
log(`Wasm Runtime initialized in ${(Date.now() - moduleLoadStart)/1000} secs`);
log(`Wasm Runtime initialized (preRun -> onRuntimeInitialized) in ${(Date.now() - moduleLoadStart)/1000} secs`);
}
};
</script>