Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.81 KB | None | 0 0
  1. // Eta shtuka gruzit cpu na 99%
  2. // ั:
  3.  
  4. namespace KEK
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             System.Console.Write("Your cpu threads count: ");
  11.             Initialize(System.Convert.ToInt32(System.Console.ReadLine()));
  12.         }
  13.  
  14.         private static void CpuUsage()
  15.         {
  16.             while (true)
  17.             {
  18.                 int i = 0;
  19.                 if (i > 0) { }
  20.             }
  21.         }
  22.  
  23.         public static void Initialize(int threads)
  24.         {
  25.             System.Threading.Thread[] threadz = new System.Threading.Thread[12];
  26.  
  27.             for (int i = 0; i < threadz.Length; i++)
  28.             {
  29.                 threadz[i] = new System.Threading.Thread(CpuUsage);
  30.                 threadz[i].Start();
  31.             }
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement