>>多个线程能否执行同一段代码
能!
>>不同的休眠时间
随机产生一个数,然后Thread.Sleep( x ) >>如果能怎么实现
查MSDN,关键字:Thread

解决方案 »

  1.   

    这样可以么doSomething ( int SleepTime)
    {
      //do something
      Sleep(SleepTime);}
      

  2.   

    你想做什么,没有表述清楚thread1()
    {
      doSomething(100);
    }thread2()
    {
      doSomething(200);
    }
      

  3.   

    这个应该很容易啊public class myClass
    {
       private int SleepTime;
       public myClass(int sleepTime)
      {
        this.SleepTime = sleepTime;
      }
      public DoSomething()
      {
        //do some thing 
        Sleep(this.SleepTime);
      }
        
    }启动部分
    static Main()
    {
      myClass first = new myClass(1000);
      Thread thread1 = new Thread(new ThreadStart(first.DoSomething));
      myClass second = new myClass(50);
      Thread thread2 = new Thread(new ThreadStart(second.DoSomething));  thread1.Start();
      thread2.Start();
    }
      

  4.   

    refer:
    http://www.yesky.com/SoftChannel/72342380468109312/20030516/1701196.shtml