Forum Discussion
Chris039
Occasional Contributor
3 years agoHi Sheng,
I tried running the second code that you have shared.
clock_t t;
t = clock();
printf ("Calculating...\n");
usleep(1000000);
printf ("Bye world...\n");
t = clock() - t;
printf ("It took me %ld clicks (%f seconds).\n",t,((float)t)/1000000);
printf ("It took me %u clicks (%x seconds).\n",t,((float)t)/1000000);
Why is my value in the bracket has negative sign and different from yours?
Chris039
Occasional Contributor
3 years agoIf I would like to delay one second in the code? what is the value I should put in usleep ()?