moo/wasm/moo.cb.js

24 lines
514 B
JavaScript
Raw Permalink Normal View History

//function _jsGetTime(pointer) <--- doesn't work as emcc produces this
var _jsGetTime = function(pointer)
{
var pos = pointer / 4;
var now = (new Date()).getTime();
HEAP32[pos] = Math.floor(now / 1000);
HEAP32[pos + 1] = (now % 1000) * 1000000;
}
2019-07-15 15:25:00 +00:00
var _jsSleep = function(pointer)
{
2019-11-03 16:02:22 +00:00
/*
2019-07-15 15:25:00 +00:00
var pos = pointer / 4;
var msec = (HEAP32[POS] * 1000) + (HEAP32[pos + 1] / 1000000);
var prom = new Promise(function (resolve, reject) {
setTimeout (function() { resolve("xxxx"); }, msec);
});
await prom;
2019-11-03 16:02:22 +00:00
*/
2019-07-15 15:25:00 +00:00
}
2019-11-03 16:02:22 +00:00