Set process priority to high on windows
This commit is contained in:
+12
@@ -19,7 +19,19 @@ struct Args {
|
||||
rom: Option<PathBuf>,
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
fn set_process_priority_to_high() -> Result<()> {
|
||||
use windows::Win32::{Foundation, System::Threading};
|
||||
let process = unsafe { Threading::GetCurrentProcess() };
|
||||
unsafe { Threading::SetPriorityClass(process, Threading::HIGH_PRIORITY_CLASS)? };
|
||||
unsafe { Foundation::CloseHandle(process)? };
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn main() -> Result<()> {
|
||||
#[cfg(windows)]
|
||||
set_process_priority_to_high()?;
|
||||
|
||||
let args = Args::parse();
|
||||
|
||||
let (mut builder, client) = EmulatorBuilder::new();
|
||||
|
||||
Reference in New Issue
Block a user