Here is a conceptual example
static bool Outcome()
{
// replace with your work
return new Random().Next(0, 99) > 50;
}
// with async/await
async Task<bool> WaitForItToWorkAsync()
{
var succeeded = false;
while (!succeeded)
{
succeeded = Outcome(); // do something
await Task.Delay(1000);
}
return succeeded;
}