The difference between the two TimeLike
s
The TimeLike
's value in nanoseconds.
Is this a finite TimeLike value?
Adds delta
to this TimeLike
.
Adds delta
to this TimeLike
. Adding Duration.Top
results
in the TimeLike
's Top
, adding Duration.Bottom
results in
the TimeLike
's Bottom
.
Rounds down to the nearest multiple of the given duration.
Rounds down to the nearest multiple of the given duration. For example: 127.seconds.floor(1.minute) => 2.minutes. Taking the floor of a Time object with duration greater than 1.hour can have unexpected results because of timezones.
Returns a value/TimeUnit
pair; attempting to return coarser
grained values if possible (specifically: TimeUnit.SECONDS
or
TimeUnit.MILLISECONDS
) before resorting to the default
TimeUnit.NANOSECONDS
.
Equality within maxDelta
A common trait for time-like values. It requires a companion
TimeLikeOps
module.TimeLike
s are finite, but they must always have two sentinels:Top
andBottom
. These act like positive and negative infinities: Arithmetic involving them preserves their values, and so on.TimeLike
s areLong
-valued nanoseconds, but have different interpretations:Duration
s measure the number of nanoseconds between two points in time, whileTime
measure the number of nanoseconds since the Unix epoch (1 January 1970 00:00:00 UTC).TimeLike behave like boxed java Double values with respect to infinity and undefined values. In particular, this means that a
TimeLike
'sUndefined
value is comparable to other values. In turn this means it can be used as keys in maps, etc.Overflows are also handled like doubles.