use wasm to speed up supports

This commit is contained in:
Stewart Allen 2021-06-22 15:06:07 -04:00
commit 3ba5601cfd
3 changed files with 31 additions and 10 deletions

View file

@ -33,6 +33,7 @@
return out;
}
/** track an array of promises as they all complete */
async function pwait(promises, tracker) {
let count = 0;
if (tracker)
@ -44,6 +45,13 @@
await Promise.all(promises);
}
/** return a promise that resolves after a given time */
function ptimer(time) {
return new Promise((resolve, reject) => {
setTimeout(resolve, time);
});
}
function numOrDefault(num, def) {
return num !== undefined ? num : def;
}
@ -504,6 +512,7 @@
round,
area2,
pwait,
ptimer,
center2d,
center2pr,
thetaDiff,