Facebook
From Morose Madrill, 7 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 309
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading;
  6. using System.Threading.Tasks;
  7. using System.Diagnostics;
  8.  
  9. namespace cw1._1
  10. {
  11.     class Program
  12.     {
  13.  
  14.           static void funkcja()
  15.           {
  16.               while (true)
  17.               {
  18.                   bool zmienna;
  19.               }
  20.           }
  21.  
  22.         static void Main(string[] args)
  23.         {
  24.             int iloscWatkow = 0;
  25.  
  26.             try
  27.             {
  28.                 while (true)
  29.                 {
  30.                     Thread watek1 = new Thread(funkcja);
  31.                     iloscWatkow++;
  32.                     watek1.Start();
  33.                     Console.WriteLine("Aktulana ilosc uruchomionych watkow: " + iloscWatkow);
  34.  
  35.                 }
  36.             }
  37.  
  38.             catch
  39.             {
  40.                 Console.ReadKey();
  41.             }
  42.         }
  43.     }
  44. }