차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

다음 판
이전 판
platform:common:troubleshooting:pc_또는_windows_교체_후_딜레이_발생 [2019/12/06 16:18]
winoars 만듦
platform:common:troubleshooting:pc_또는_windows_교체_후_딜레이_발생 [2024/07/08 18:23] (현재)
줄 1: 줄 1:
-======프로그램 딜레이 발생======+======프로그램 느려짐, 타밍 문제 발생======
 <alert type="info" dismiss="true" icon="fa fa-quote-left"> <alert type="info" dismiss="true" icon="fa fa-quote-left">
 PC 교체, Windows 재설치 이후 Application에서 딜레이가 발생하는 경우에 대한 안내 페이지입니다. PC 교체, Windows 재설치 이후 Application에서 딜레이가 발생하는 경우에 대한 안내 페이지입니다.
줄 6: 줄 6:
  
  
-=====Case 1===== +<callout type="primary"> 
- +
-<callout type="info" icon="true"> +
 ===증상=== ===증상===
   * Application 의 변경 없이 **프로그램이 느려지거나 타이밍 문제 발생**   * Application 의 변경 없이 **프로그램이 느려지거나 타이밍 문제 발생**
줄 17: 줄 15:
 \\ \\
 ===발생 시점=== ===발생 시점===
- 
     * PC 교체 후     * PC 교체 후
  
줄 23: 줄 20:
 </callout> </callout>
  
-<callout type="question" icon="true"> +<callout type="info"> 
 ===원인=== ===원인===
   * **Windows의 Timer Resolution이 기본값으로 설정되어 있음**   * **Windows의 Timer Resolution이 기본값으로 설정되어 있음**
줄 36: 줄 33:
 </callout> </callout>
  
-<callout type="success" icon="true">  +<callout type="success">  
-===Soultion (C++)===+ 
 +===Solution (ComiIDE)=== 
 +  * **[[application:comiide:tool:shell:shell_timer_resolution| Shell을 이용한 TimerResolution 확인, 변경]]** 참조
 \\ \\
 +
 +===Soultion (C++)===
 <code> <code>
 // timeBeginPeriod 사용 // timeBeginPeriod 사용
줄 60: 줄 61:
 timeEndPeriod(wTimerRes);  timeEndPeriod(wTimerRes); 
 </code> </code>
 +\\
  
 +===Solution (C#)===
 +<code>
 +[DllImport("ntdll.dll", SetLastError = true)]
 +private static extern NtStatus NtSetTimerResolution(
 +    uint DesiredResolution, 
 +    bool SetResolution, 
 +    ref uint CurrentResolution);
 +
 +public static float SetTimerResolution(uint timerResolutionIn100nsUnits, bool doSet = true)
 +{
 +// 입출력값의 단위는 100ns
 +// 1ms로 변경 시 SetTimerResolution(10000);
 +// Enum NtStatus 는 별도 정의, 불필요 시 int로 대체
 +
 +    uint currentRes_100ns = 0;
 +    var result = NtSetTimerResolution(timerResolutionIn100nsUnits, doSet, ref currentRes_100ns);            
 +    return currentRes_100ns;
 +}        
 +</code>
 </callout> </callout>