clock_gettime (1) 썸네일형 리스트형 시간 정밀 측정 clock_gettime을 이용해서 정밀한 시간측정을 할 수 있다. #define PER_MICROSEC 1000 #define PER_MILLISEC 1000000 #define PER_SEC 1000000000 const long long NANOS = 1000000000LL; static struct timespec startTS, endTS; static long long retDiff = 0; //시간측정 시작 clock_gettime(CLOCK_MONOTONIC, &startTS); //이곳에 측정할 함수를 위치시킨다. //시간측정 종료 clock_gettime(CLOCK_MONOTONIC, &endTS); retDiff = NANOS * (endTS.tv_sec-startTS.tv_sec) .. 이전 1 다음