Java 持续时间 class 的长度?
Java Duration-like class for length?
在 Java 中,时间跨度有 Duration
and Period
classes。
是否有 length/distance 的等效 class?
有几个:int
、short
、long
、float
、double
、java.util.BigInteger
...所有这些适合测量距离。在许多情况下,这些也足以测量时间。存在用于测量持续时间的特殊 class 的唯一原因是 code that deals with time is often infuriatingly hard to get 100% right.
在 Java 中,时间跨度有 Duration
and Period
classes。
是否有 length/distance 的等效 class?
有几个:int
、short
、long
、float
、double
、java.util.BigInteger
...所有这些适合测量距离。在许多情况下,这些也足以测量时间。存在用于测量持续时间的特殊 class 的唯一原因是 code that deals with time is often infuriatingly hard to get 100% right.