应该是这样,而且它只能出略的判断一下,因为System.currentMilltime()也会因为进行方法调用而消耗时间的!
解决方案 »
- 自动填写
- 客户端sorket编程 读取网络电子称数据
- 高分请教:sun的jdk虚拟内存回收
- 欢迎讨论:java 中为什么设计重载?
- 关于通讯多线程的?
- 200分求助,升级mysql驱动到3.1.7设置字符编码没有任何作用了!!!!
- 怎么评价一个程序员的代码质量呢?各位所在公司都有什么评价标准呢?
- fileoutputStream 无法换行输入的问题
- 简单问题,构造函数
- 在Applet中如何弹出模式窗体?
- 有谁知道如何做一个html文件中的tree,就像www.helpwork.com那样的。在线等待,问题解决一定送高分!!!
- JAVA中有没有拷贝构造函数这个概念?相同类型的对象间可以直接赋值吗?
.....
t2.start();------------这样run() 方法就被重用了
大多数系统只能精确到10毫秒,有误差是正常的。这和操作系统确实很有关系。如果你的操作系统支持,java还有一个支持精确到纳秒的方法呢!
是什么啊?
Causes the currently executing thread to sleep (cease execution) for the specified number of milliseconds plus the specified number of nanoseconds.
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. 不过没用,没有谁的机器能支持到纳秒的