In c# I would do this -
double progress = 0;
while (progress < 100)
{
var result = await PerformAsync();
progress = result.Progress;
await Task.Delay();
}
A nice simple 7 lines of code. What's the equivalent in node.js ? Basically need a while loop that checks a condition, and until that condition is met, sleeps and then executes some async operation.