timeGetTime Function
https://docs.microsoft.com/en-us/windows/win32/api/timeapi/nf-timeapi-timegettime
timeGetTime function (timeapi.h)
The timeGetTime function retrieves the system time, in milliseconds. The system time is the time elapsed since Windows was started.
docs.microsoft.com
timeGetTime 함수는 밀리 초 단위로 시스템 시간을 검색한다. 시스템 시간은 Windows가 시작된 이후 경과 된 시간이다.
Syntax
DWORD timeGetTime();
Parameters
이 함수는 파라미터가 없다.
Return Value
밀리세컨드 단위로 시스템 시간을 반환한다.
Remarks
1. 이 함수와 timeGetSystemTime 함수의 유일한 차이점은 timeGetSystemTime이 MMTIME 구조를 사용하여 시스템 시간을 반환한다는 것이다. timeGetTime 함수는 timeGetSystemTime 함수보다 오버헤드가 적다.
2. timeGetTime 함수에 의해 반환된 값은 DWORD 값이라는 점에 유의해라. 반환 값은 약 49.71일인 2^32밀리초마다 0으로 래핑된다. 이는 특히 값이 코드 실행을 제어하는 데 사용되는 경우 계산에서 timeGetTime 반환 값을 직접 사용하는 코드에서 문제를 일으킬 수 있다. 계산에서 항상 두 시간 GetTime 반환 값의 차이를 사용해야 한다.
3. timeGetTime 함수의 기본 정밀도는 기계에 따라 5밀리초 이상이 될 수 있다. timeBeginPeriod 및 timeEndPeriod 함수를 사용하여 TimeGetTime의 정밀도를 높일 수 있다. 이 경우, timeGetTime에 의해 반환된 연속 값 사이의 최소 차이는 timeBeginPeriod와 timeEndPeriod를 사용하여 설정된 최소 기간 값만큼 클 수 있다. QueryPerformanceCounter 및 QueryPerformanceFrequency 함수를 사용하여 고해상도에서의 짧은 시간 간격을 측정해라.
Requirements
1. Minimum supported client
Windows 2000 Professional [desktop apps only]
2. Minimum supported server
Windows 2000 Server [desktop apps only]
3. Target Platform
Windows
4. Header
timeapi.h (include Windows.h)
5. Library
Winmm.lib
6. DLL
Winmm.dll
'ETC > Windows API' 카테고리의 다른 글
GetDlgItemInt Function (0) | 2019.08.20 |
---|---|
GetDlgItemTextA Function (0) | 2019.08.13 |
IsDebuggerPresent Function (0) | 2019.08.09 |
DialogBoxParamA Function (0) | 2019.08.07 |
GetDlgItemTextA Function (0) | 2019.07.17 |