실행시간 측정방법 (POSIX)
#include <unistd.h>
#include <sys/times.h>
timeMeasure()
{
double ticksPerSec, diff;
struct tms start, end;
clock_t startTick, endTick, userTicks, systemTicks;;
ticksPerSec = (double)sysconf(_SC_CLK_TCK);
startTick = times(&start);
funcToBeTested();
endTick = times(&end);
userTicks = end.tms_utime - start.tms_utime;
systemTicks = end.tms_stime - start.tms_stime;
diff = (double)userTicks / ticksPerSec;
printf("user mode CPU time : %f\n", diff);
diff = (double)systemTicks / ticksPerSec;
printf("system mode CPU time : %f\n", diff);
diff = (double)(endTick - startTick) / ticksPerSec;
printf("elapsed real-world time : %f\n", diff);
}