[time.duration.alg]

# 30 Time library [[time]](./#time)

## 30.5 Class template duration [[time.duration]](time.duration#alg)

### 30.5.10 Algorithms [time.duration.alg]

[ð](#lib:abs,duration)

`template<class Rep, class Period>
  constexpr duration<Rep, Period> abs(duration<Rep, Period> d);
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L2043)

*Constraints*: numeric_limits<Rep>​::​is_signed is true[.](#1.sentence-1)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L2047)

*Returns*: If d >= d.zero(), return d,
otherwise return -d[.](#2.sentence-1)
