GetTickCount
"Retrieves the number of milliseconds that have elapsed since the system was started, up to 49.7 days"
So it's quite simple;
Code:int tickStart = GetTickCount(); // Right now. int tickEnd = tickStart + 5000; // 5 seconds into the future while(GetTickCount() < tickEnd) { // Do nothing, although it's better to Sleep(0) in here to not waste CPU time. } MessageBox.Show("Hurraiiii, 5 seconds have passed.");