|
멀티미디어 타이머가 제일 정확한 걸로 알고 있습니다..
#include <time.h>
#include <Mmsystem.h>
clock_t StartClock, EndClock;
DWORD StartMMTime, EndMMTime, StartTick, EndTick;
StartClock = clock();
StartTick = GetTickCount();
StartMMTime = timeGetTime();
Sleep(1711);
EndClock = clock();
EndTick = GetTickCount();
EndMMTime = timeGetTime();
printf("The time was: %f, %d, %d\n", (EndClock - StartClock) / CLK_TCK, (EndTick - StartTick), (EndMMTime - StartMMTime));
심심해서 3가지 타임 체크 함수로 테스트해봤는데요.. ㅡ.ㅡ timeGetTime()이 제일 정확한 걸 알 수 있습니다..
비교해보세요..
말썽이네.. 님이 쓰신 글 :
: 그냥 clock 함수 그대로 먹히네요.
: #include "time.h"
: {
: long i = 60000000L;
: clock_t start, finish;
: double duration;
:
: // Measure the duration of an event.
: printf("%i 루프를 수행하는 시간은 ", i);
: start = clock();
: while( i-- )
: ;
: finish = clock();
: duration = (double)(finish - start) / CLOCKS_PER_SEC;
: printf("%f 초입니다.\n", duration);
:
: return 0;
: }
: 이런이런 ^^;
:
: 말썽이네.. 님이 쓰신 글 :
: : 연산을 시작해서 연산 마칠때 걸리는 시간 알려주는 함수가 있나요?
: : 도움말에선 datetime만 있는거 같아서요
: : 아시면 좀 알려주세요
: : ^^;
|