델.마. 님이 쓰신 글 :
: 안녕하세요!
:
: 참고만.하세요!
:
: 윈도에서.정밀한.시간측정을.위해선
: 굳이.컴포넌트를.사용하기보단..
:
: {아마도.추측컨데.님의.컴포는.스레드기반이라...
: 멀티스레딩시.일반적.오류가.있을지도..)
:
: GetTickCount();
:
: 위.API를.사용하시면.어떨까요?
: 1/1000초까지.측정가능합니다.
: 님의.25msec정도는.충분할듯...
: 하지만.이넘도.약간의.오차가.있는지라
: (윈도특징상..아시져?)
:
: 아래함수를.사용하시면.함수반환시간까지.
: 고려해서.정확한.시간을.반납합니다.
:
: double __fastcall GetTime()
: {
: LARGE_INTEGER liEndCounter,liFrequency ;
: QueryPerformanceCounter(&liEndCounter);
: QueryPerformanceFrequency(&liFrequency);
:
: return (liEndCounter.QuadPart / (double)liFrequency.QuadPart) * 1000;
: }
:
: : oMega
:
임펠리테리입니다.
저도 때때로 GetTickCount() 함수를 씁니다만, 이 함수는 1000분의 1초 단위로 측정하지 못합니다. 빌더에 포함되어 있는 Win32 Programmer's Reference에는 그런 말이 없지만, MSDN에서 이 함수를 찾아보면 다음과 같은 설명이 되어 있습니다.
The GetTickCount function retrieves the number of milliseconds that have elapsed since the system was started. It is limited to the resolution of the system timer. To obtain the system timer resolution, use the GetSystemTimeAdjustment function.
...
If you need a higher resolution timer, use a multimedia timer or a high-resolution timer.
...
이 문서의 url은 http://msdn.microsoft.com/library/psdk/sysmgmt/time_8wz8.htm 입니다.
그럼 참고하시길...
|