/* time_cpu.c see if C time.h clock() is OK */ /* run with no other program running */ #include #include int main() { int i; double now; double next; printf("CPU time Should be wall time, 5 second intervals \n"); now = (double)clock()/(double)CLOCKS_PER_SEC; next = now+5.0; for(i=0; i<90;) { now = (double)clock()/(double)CLOCKS_PER_SEC; if(now >= next) { printf("%d\n",i); i=i+5; next=next+5.0; } } return 0; }