perl6/doc/lib/Duration
doc src
The following built-in types inherit from Cool :
L<Array> L<Backtrace> L<Bag> L<Baggy> L<Bool> L<Complex> L<Cool>
L<Duration> L<Enumeration> L<EnumMap> L<FatRat> L<Hash> L<Instant>
L<Int> L<Iterable> L<Iterator> L<KeyHash> L<KeySet> L<List>
L<ListIter> L<LoL> L<MapIter> L<Nil> L<Num> L<Numeric> L<Parcel>
L<Range> L<Real> L<Seq> L<Set> L<Stash> L<Str> L<Stringy>
The following table summarizes the methods that Cool provides, and
what type they coerce to:
(title) Duration
class Duration is Cool does Real { }
A Duration represents a length of time in atomic seconds, with
fractions. Like an L<Instant>, it is epoch-agnostic. In numeric contexts
(situations where a Duration is used as a number), a Duration will return
either a L<Rat> or a L<FatRat> representing the number of seconds it holds.
Duration s can be subtracted from or added to Instant s to yield another,
new Instant . Subtracting one Instant from another yields a Duration .
A Duration can also result from mathematical operations between
two Duration s when it makes sense (namely, the addition, subtraction, or
modulous of two Duration s). The type of object returned for other numeric
operations is currently unspecified.