+ Reply to Thread
Results 1 to 2 of 2

Thread: Set Priority to realtime

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    35

    Set Priority to realtime

    Some of you might have some applications that are slow , like games for example ? , maybe your game is running but not smooth enough and you want to let the computer resources focus on that game most of the time , so the game won't be slow right ?

    So i though what if i created a small tool that set some process's to Realtime priority.

    How can i do that in C# ?
    Last edited by davis; 11-11-2012 at 09:46 AM.

  2. #2
    Junior Member
    Join Date
    Jun 2012
    Posts
    28
    The basic idea is to locate that application in task manager and right click and assign priority to RealTime.
    And i'll show you how to do that in C# , the code is so simple .

    1- Retrieve all processes
    2- choose the one you need to assign priority to it.

    c#[.NET 2] CODE :
    Code:
                foreach (Process p in Process.GetProcesses())  // Retrieve all processes
                {
                    if (p.ProcessName.Contains("processName")) // pick your process where processname could be firefox for example.
                    {
                        p.PriorityClass = ProcessPriorityClass.RealTime; // assign priority
                        Console.WriteLine("DONE!");
                    }
                }
    ** P.S : Assigning a process to realtime could affect the other processes , for example if a game`s priority is realtime and you have a music in the background running , the music may flicker(Stop/play/stop/play , etc......)

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts