Very useful code:
void delay(double time_limit) { int lim = time_limit*1000000-10000; int s = clock(); while(clock()-s < lim){} }