fork download
  1. using System;
  2. using System.Threading;
  3. class DataPro
  4. {
  5. public void MyPro1()
  6. {
  7. for(int i=0;i<5;i++)
  8. {
  9. System.Console.Write(i);
  10. Thread.Sleep(1);
  11. }
  12. }
  13. public void MyPro2()
  14. {
  15. for(int j=0;j<5;j++)
  16. {
  17. System.Console.Write(j);
  18. Thread.Sleep(1);
  19. }
  20. }
  21. }
  22. class DemoPro
  23. {
  24. static void Main()
  25. {
  26. DataPro d1 = new DataPro();
  27. Thread t1 = new Thread(d1.MyPro1);
  28. Thread t2 = new Thread(d1.MyPro2);
  29. t1.Start();
  30. t2.Start();
  31. }
  32. }
Success #stdin #stdout 0.03s 39096KB
stdin
Standard input is empty
stdout
0011223344