You'll want to verify the syntax as I'm just wingin' it, but this will go into a non-blocking loop for the designated amount of time...
// Set the wait time
double waitTime = 5.0;
// Get the current time
DateTime start = DateTime.Now;
// Check the wait time
while(DateTime.Now.Subtract(start).TotalSeconds < waitTime)
{
// Keep the thread from blocking
Application.DoEvents();
}
That assumes you're using Windows Forms. If you're using WPF:
//Application.DoEvents();
this.Dispatcher.Invoke(DispatcherPriority.Background, new Action(() => { }));
Again, you'll want to verify the syntax first...