C++ Delay Function
#include
void delay(int n)
{
clock_t start_time, cur_time; start_time = clock(); while((clock() - start_time) < n * CLOCKS_PER_SEC)
{}
}
int main()
{
// do something
delay(5);
// delays 5 seconds
}
Come to The Dark Side, We Have Cookies!
#include
void delay(int n)
{
clock_t start_time, cur_time; start_time = clock(); while((clock() - start_time) < n * CLOCKS_PER_SEC)
{}
}
int main()
{
// do something
delay(5);
// delays 5 seconds
}