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. }
  19. }
  20. }
  21. class DemoPro
  22. {
  23. static void Main()
  24. {
  25. DataPro d1 = new DataPro();
  26. Thread t1 = new Thread(d1.MyPro1);
  27. Thread t2 = new Thread(d1.MyPro2);
  28. t1.Start();
  29. t2.Start();
  30. }
  31. }
Success #stdin #stdout 0.03s 39104KB
stdin
Standard input is empty
stdout
0012341234