차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
다음 판 | 이전 판 | ||
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=" | <alert type=" | ||
PC 교체, Windows 재설치 이후 Application에서 딜레이가 발생하는 경우에 대한 안내 페이지입니다. | PC 교체, Windows 재설치 이후 Application에서 딜레이가 발생하는 경우에 대한 안내 페이지입니다. | ||
줄 6: | 줄 6: | ||
- | =====Case 1===== | + | <callout type="primary"> |
- | + | ||
- | <callout type="info" icon=" | + | |
===증상=== | ===증상=== | ||
* Application 의 변경 없이 **프로그램이 느려지거나 타이밍 문제 발생** | * Application 의 변경 없이 **프로그램이 느려지거나 타이밍 문제 발생** | ||
줄 17: | 줄 15: | ||
\\ | \\ | ||
===발생 시점=== | ===발생 시점=== | ||
- | |||
* PC 교체 후 | * PC 교체 후 | ||
줄 23: | 줄 20: | ||
</ | </ | ||
- | <callout type="question" | + | <callout type="info"> |
===원인=== | ===원인=== | ||
* **Windows의 Timer Resolution이 기본값으로 설정되어 있음** | * **Windows의 Timer Resolution이 기본값으로 설정되어 있음** | ||
줄 36: | 줄 33: | ||
</ | </ | ||
- | <callout type=" | + | <callout type=" |
- | ===Soultion | + | |
+ | ===Solution | ||
+ | * **[[application: | ||
\\ | \\ | ||
+ | |||
+ | ===Soultion (C++)=== | ||
< | < | ||
// timeBeginPeriod 사용 | // timeBeginPeriod 사용 | ||
줄 60: | 줄 61: | ||
timeEndPeriod(wTimerRes); | timeEndPeriod(wTimerRes); | ||
</ | </ | ||
+ | \\ | ||
+ | ===Solution (C#)=== | ||
+ | < | ||
+ | [DllImport(" | ||
+ | private static extern NtStatus NtSetTimerResolution( | ||
+ | uint DesiredResolution, | ||
+ | bool SetResolution, | ||
+ | ref uint CurrentResolution); | ||
+ | |||
+ | public static float SetTimerResolution(uint timerResolutionIn100nsUnits, | ||
+ | { | ||
+ | // 입출력값의 단위는 100ns | ||
+ | // 1ms로 변경 시 SetTimerResolution(10000); | ||
+ | // Enum NtStatus 는 별도 정의, 불필요 시 int로 대체 | ||
+ | |||
+ | uint currentRes_100ns = 0; | ||
+ | var result = NtSetTimerResolution(timerResolutionIn100nsUnits, | ||
+ | return currentRes_100ns; | ||
+ | } | ||
+ | </ | ||
</ | </ |