一、线程休眠 sleep
package ThreadTest;
import java.text.SimpleDateFormat;
import java.util.Date;
// 模拟时间打表
public class TestSleep {
public static void main(String[] args) {
//获取系统当前时间
Date startTime = new Date(System.currentTimeMillis());
while(true)
{
try {
Thread.sleep(1000);
System.out.println(new SimpleDateFormat("HH:mm:ss")