我有一个功能:
Thread myThread = new Thread(new Runnable() {
@Override
public void run() {
while (true) {
try {
Thread.sleep(500);
myThread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
});
打电话Thread.sleep(500);
和打电话一样myThread.sleep(500);
吗?
两个不同的调用之间有什么区别吗?