Duration Bottom
is smaller than any other duration, except for
itself.
Duration Bottom
is smaller than any other duration, except for
itself. Bottom
's complement is Top
.
An extractor for finite TimeLikes; eg.:
An extractor for finite TimeLikes; eg.:
duration match { case Duration.Finite(d) => ... case Duration.Top => ..
An extractor for finite This
, yielding its value in nanoseconds.
An extractor for finite This
, yielding its value in nanoseconds.
duration match { case Duration.Nanoseconds(ns) => ... case Duration.Top => ... }
Duration Top
is greater than any other duration, except for
itself.
Duration Top
is greater than any other duration, except for
itself. Top
's complement is Bottom
.
An undefined value: behaves like Double.NaN
An undefined value: behaves like Double.NaN
The zero value
The zero value
Create a duration from a java.util.concurrent.TimeUnit.
Make a new This
from the given number of seconds.
Make a new This
from the given number of seconds.
Because this method takes a Double, it can represent values less than a second.
Note however that there is some slop in floating-point conversion that
limits precision. Currently we can assume at least microsecond precision.
Make a new This
from the given number of nanoseconds
Make a new This
from the given number of nanoseconds
Create a duration from a java.util.concurrent.TimeUnit.
Create a duration from a java.util.concurrent.TimeUnit.
Synonym for apply
.
Parse a String representation of a duration.
Parse a String representation of a duration. This method will parse any duration generated by Duration.toString.
The format is either one of the special values, or non-empty sequence of durations. Each duration is a sign, an integer, a dot, and a unit. The unit may be plural or singular. The parser will ignore whitespace around signs and at the beginning and end. (That is, it accepts "1.second + 1.minute" and " 1.second ".) It's permissible to omit the sign before the first duration.
The special values are "Duration.Top", "Duration.Bottom" and "Duration.Undefined".
The parser is case-insensitive.
RuntimeException
if the string cannot be parsed.
(Since version 5.4.0) Use Duration.Top
(Since version 5.4.0) Use Duration.Zero
Synonym to Top
Synonym to Top
(Since version 5.4.0) use Duration.Top
Synonym to Top
Synonym to Top
(Since version 5.4.0) use Duration.Top
Returns how long it took, in millisecond granularity, to run the function f.
Returns how long it took, in millisecond granularity, to run the function f.
(Since version 5.4.0) use Stopwatch instead
Returns how long it took, in nanosecond granularity, to run the function f.
Returns how long it took, in nanosecond granularity, to run the function f.
(Since version 5.4.0) Use Stopwatch
(Since version 2011-05-03) use time.untilNow
(Since version 5.4.0) use Duration.Zero