Is there a better waiting pattern for c#?

Viewed 5867

I've found myself coding this type of thing a few times.

for (int i = 0; i < 10; i++)
{
   if (Thing.WaitingFor())
   {
      break;
   }
   Thread.Sleep(sleep_time);
}
if(!Thing.WaitingFor())
{
   throw new ItDidntHappenException();
}

It just looks like bad code, is there a better way of doing this / is it a symptom of bad design?

9 Answers
Related