clock_test.c
public text v1 · immutable#include <stdio.h>
#include <time.h>
#include <math.h>
int main(void)
{
clock_t before, after;
before = clock();
while ((after = clock()) == before) {
double d = sin(time(NULL));
}
printf("before = %f\n", (double)before);
printf("after = %f\n", (double)after);
printf("CLOCKS_PER_SEC = %f\n", (double)CLOCKS_PER_SEC);
return 0;
}