알고리즘
-
시간측정 :: sysconf, times정리필요2 2007. 9. 25. 07:33
실행시간 측정방법 (POSIX) #include #include 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; ..