add promising tracking for progress bar
This commit is contained in:
parent
8e6a1e5747
commit
0e46b58876
3 changed files with 40 additions and 10 deletions
|
|
@ -31,7 +31,18 @@
|
|||
out.push(from);
|
||||
}
|
||||
return out;
|
||||
};
|
||||
}
|
||||
|
||||
async function pwait(promises, tracker) {
|
||||
let count = 0;
|
||||
if (tracker)
|
||||
for (let p of promises) {
|
||||
p.then(() => {
|
||||
tracker(count++, promises.length);
|
||||
});
|
||||
}
|
||||
await Promise.all(promises);
|
||||
}
|
||||
|
||||
function numOrDefault(num, def) {
|
||||
return num !== undefined ? num : def;
|
||||
|
|
@ -492,6 +503,7 @@
|
|||
time,
|
||||
round,
|
||||
area2,
|
||||
pwait,
|
||||
center2d,
|
||||
center2pr,
|
||||
thetaDiff,
|
||||
|
|
|
|||
Loading…
Reference in a new issue