package thead.start.thread_6;

import java.time.LocalDateTime;
import java.util.concurrent.TimeUnit;

public class ObjectService {
    public void serviceMethod() throws InterruptedException {
        synchronized (this) {
            System.out.println("开始时间：" + LocalDateTime.now());
            TimeUnit.SECONDS.sleep(2);
            System.out.println("结束时间：" + LocalDateTime.now());
        }
    }
}
