thread cpu usage
-
I got CPU usage of each process using API but i can't do it with threads. How can i get cpu usage of each thread using API and c#?
-
I got CPU usage of each process using API but i can't do it with threads. How can i get cpu usage of each thread using API and c#?
This is example of Thread. CODE: static void Main(string[] args) { Thread t1 = new Thread(new ThreadStart(Thread1)); Thread t2 = new Thread(new ThreadStart(Thread2)); t1.Priority = ThreadPriority.BelowNormal ; t2.Priority = ThreadPriority.Lowest ; t1.Start(); t2.Start(); } public static void Thread1() { for (int i = 1; i < 1000; i++) { dosth(); Console.Write("1"); } } public static void Thread2() { for (int i = 0; i < 1000; i++) { dosth(); Console.Write("2"); } } public static void dosth() { for (int j = 0; j < 10000000; j++) { int a=15; a = a*a*a*a; } }
-
I got CPU usage of each process using API but i can't do it with threads. How can i get cpu usage of each thread using API and c#?
How to get CPU usage of processes and threads[^] may explain that.
Navaneeth How to use google | Ask smart questions