|
|
看看我的run()函数:
long lastTime;
public void run() {
while (true) {
try
{
lastTime= System.currentTimeMillis();
Thread.sleep(80);
long dt = System.currentTimeMillis() - s_lastTimeMillis;
System.out.println(dt);
}catch(Exception e)
{
e.printStackTrace();
}
}
输出结果:
Collected 9452 bytes of garbage. Heap size 36864 bytes
250
203
203
203
204
203
187
203
203
204
203
203
203
203
188
203
203
203
203
203
203
203
188
203
203
203
203
Garbage collecting...
Collected 7868 bytes of garbage. Heap size 36864 bytes
204
203
203
203
187
204
203
203
203
94
203
一睡都睡200多毫秒,可不慢
这是为什么呀?有人知道吗?
|
|