A Rust-based tool for benchmarking system timer resolution to achieve precise sleep intervals, optimizing performance and consistency for high-performance tasks like gaming, especially in low-latency scenarios. It automatically detects HPET status and identifies the optimal timer resolution for your system.
-
Checks if HPET is enabled or disabled during benchmark setup.
-
Customizable Benchmark Parameters
-
Automatically detects the optimal timer resolution for your system based on the lowest sleep delta and standard deviation.
-
Rewritten in Rust for better performance and less overhead.
-
GUI (under development)
-
Graph (under development)
- Disable HPET and set up an Idle-disabled power plan (follow the Troubleshooting guide for help).
- Download the latest release from GitHub Releases.
- Extract the
.7z
archive. - Run
timer_res_benchmark.exe
as an administrator.- You can adjust the benchmark parameters directly in the program or modify them manually in the 'appsettings.json' file(default value).
- After the benchmark completes, it will automatically detect the optimal timer resolution for your system. The results and additional details will be saved in the 'results.txt' file.
- Create a shortcut for
SetTimerResolution.exe
. - Place the shortcut in your
shell:startup
folder with the following target:
C:\PATH\TO\SetTimerResolution.exe --no-console --resolution 5000
- Replace
5000
with your optimal resolution (e.g.,5000
for 0.5ms).
- Restart your PC and verify the settings using
MeasureSleep.exe
.
- Visit Plotly Chart Studio.
- Click "Import" at the top right and upload the
results.txt
file. - Add a trace and configure the settings as shown below:
- Look for the lowest
Sleep(1) Delta
on the y-axis. This represents the most precise and consistent 1ms sleep delays.- Example: If the lowest delta is at 0.5024ms, this is your optimal timer resolution.
- Disable HPET:
- Open Command Prompt as administrator and run:
bcdedit /deletevalue useplatformclock bcdedit /set disabledynamictick yes
- On Windows Server 2022+ and Windows 11+, apply this registry change:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel] "GlobalTimerResolutionRequests"=dword:00000001
- You can now verify HPET status via this program:
- Use an Idle-Disabled Power Plan:
- Download the Muren power plan.
- Import the plan using Command Prompt:
powercfg -import C:\PATH\TO\MUREN.POW
- Set your power plan to Muren.
- Disables HPET and uses more stable timers (e.g., TSC at 3.32MHz) for better frame rate consistency and lower latency.
- Unlike the original PowerShell-based benchmark, this tool is now a native executable written in Rust, making it faster and easier to use.
- This tool was initially rewritten from C# to Rust as part of a learning project. Contributions and feedback are always welcome!
This project is licensed under the MIT License. See the LICENSE file for details.