I am traying to create a delay function using time.h
But as you see this function get seconds (int) and I want it to work with miliseconds (like delay & sleep).Code:#include <time.h>
void Delay (unsigned int Sec)
{
clock_t ticks1 = clock(), ticks2 = ticks1;
while ( ( ticks2/CLOCKS_PER_SEC - ticks1/CLOCKS_PER_SEC ) < Sec)
ticks2 = clock();
}
So how can I do that? (maybe another type (clock_t)?)
Thanks.