#include <stdio.h>
#include <time.h>
void wait ( int seconds )
{
clock_t endwait;
endwait = clock () + seconds * CLK_TCK ;
while (clock() < endwait) {}
}
int main ()
{
int n;
printf ("Starting countdown...
");
for (n=10; n>0; n--)
{
printf ("%d
",n);
wait (1);
}
printf ("End!!!
");
return 0;
}
but i have to use float values. another possiblity would be time() but also this function only returns int values. i have to use this code on mac,linux and win. any alternatives? how would you do this?