restore process priority 10 seconds after startup

This commit is contained in:
Kang Yu 2025-05-03 17:24:44 -07:00
parent 4df563f1bb
commit cad1ec393f
2 changed files with 10 additions and 12 deletions

View file

@ -48,15 +48,6 @@ if not errorlevel 1 goto wait_to_finish";
[STAThread]
static void Main(string[] args)
{
var process = Process.GetCurrentProcess();
var process_priority = process.PriorityClass;
process.PriorityClass = ProcessPriorityClass.High;
var timer = new System.Threading.Timer(state =>
{
process.PriorityClass = process_priority;
});
timer.Change(10000, System.Threading.Timeout.Infinite);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
@ -65,6 +56,15 @@ if not errorlevel 1 goto wait_to_finish";
pwp = new PersistentWindowProcessor();
var process = Process.GetCurrentProcess();
pwp.processPriority = process.PriorityClass;
process.PriorityClass = ProcessPriorityClass.High;
var timer = new System.Threading.Timer(state =>
{
process.PriorityClass = pwp.processPriority;
});
timer.Change(10000, System.Threading.Timeout.Infinite);
bool splash = true;
int delay_restart = 0;
int relaunch_delay = 0;