Java 9
In Java 9 the TimeUnit
API got extended and allows to convert between TimeUnit
and ChronoUnit
:
TimeUnit.toChronoUnit() // returns a ChronoUnit
TimeUnit.of(ChronoUnit chronoUnit) // returns a TimeUnit
see: JDK-8141452
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…