Sleep() 시간 해상도 조절 팁


윈도우 플랫폼에서 사용한 Sleep()함수의 시간 해상도는 아래 함수로 조정할 있다.

MMRESULT timeBeginPeriod( UINT uPeriod ); 
MMRESULT timeEndPeriod( UINT uPeriod );

TimeAPI.h 선언되어 있으며, Winmm.lib 라이브러리를 추가해야 한다.

프로그램 시작 timeBeginPeriod 호출하여 해상도를 조정하여 Sleep함수를 사용하고, 마지막으로 프로그램 종료 timeEndPeriod 호출한다.

댓글

이 블로그의 인기 게시물

간단한 cfar 알고리즘에 대해

windows에서 간단하게 크롬캐스트(Chromecast)를 통해 윈도우 화면 미러링 방법

base64 인코딩 디코딩 예제 c 소스

아두이노(arduino) 심박센서 (heart rate sensor) 심박수 측정 example code

python asyncio를 이용한 async socket server client example code