package chapter5;

import java.time.Duration;
import java.time.LocalTime;

public class Example24 {
    public static void main(String[] args) {
        LocalTime start = LocalTime.now();
        LocalTime end = LocalTime.of(21, 53, 0);

        Duration duration = Duration.between(start, end);

        System.out.println("时间间隔（纳秒）" + duration.toNanos());
        System.out.println("时间间隔（毫秒）" + duration.toMillis());
        System.out.println("时间间隔（秒）" + duration.toSeconds());
        System.out.println("时间间隔（分钟）" + duration.toMinutes());
        System.out.println("时间间隔（小时）" + duration.toHours());

    }
}
