应该是这样,而且它只能出略的判断一下,因为System.currentMilltime()也会因为进行方法调用而消耗时间的!

解决方案 »

  1.   

    谢谢,不过还有个问题,Thread重用是怎么一回事啊?能讲一个大体的实现方法吗?
      

  2.   

    Thead t2 = new Thread();
    .....
    t2.start();------------这样run() 方法就被重用了
      

  3.   

    我是说当t2的任务完成后,再重用,也就是说已经start了,现在还想让它“start”
      

  4.   

    那只能重建对象,一个线程dead以后,你是不能再次start它的。
      

  5.   

    nirvana_hg说得对,不能等一个线程死掉之后再start他
    大多数系统只能精确到10毫秒,有误差是正常的。这和操作系统确实很有关系。如果你的操作系统支持,java还有一个支持精确到纳秒的方法呢!
      

  6.   

    "java还有一个支持精确到纳秒的方法呢?"
    是什么啊?
      

  7.   

    sleep(long millis, int nanos) 
              Causes the currently executing thread to sleep (cease execution) for the specified number of milliseconds plus the specified number of nanoseconds.
      

  8.   

    我是说得到当前的时间,不是sleep
      

  9.   

    Thread的纳秒级方法:
    static void sleep(long millis, int nanos) 
              Causes the currently executing thread to sleep (cease execution) for the specified number of milliseconds plus the specified number of nanoseconds. 不过没用,没有谁的机器能支持到纳秒的