txt: ## duration.md
  class Duration
  
  Length of time
  
  ```raku
  class Duration is Cool does Real { }
  ```
  
  A `Duration` represents a length of time in atomic seconds, with fractions. Like an [`Instant`](/type/Instant), it is epoch-agnostic.
  
  `Duration`s can be subtracted from or added to [`Instant`](/type/Instant)s to yield another, new [`Instant`](/type/Instant). Subtracting one [`Instant`](/type/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 modulus of two `Duration`s). It can also be added, subtracted or divided modulo [`Real`](/type/Real) numbers.
  
  The type of object returned for other numeric operations is currently unspecified.
  
  # [Typegraph](# "go to top of document")[§](#typegraphrelations "direct link")
  
  Type relations for `Duration`
  
  
  
  raku-type-graph
  
  
  
  Duration
  Duration
  
  
  Cool
  Cool
  
  
  Duration->Cool
  
  
  
  Real
  Real
  
  
  Duration->Real
  
  
  
  Mu
  Mu
  
  
  Any
  Any
  
  
  Any->Mu
  
  
  
  Cool->Any
  
  
  
  Numeric
  Numeric
  
  
  Real->Numeric
  
  [Expand chart above](/assets/typegraphs/Duration.svg)
  