Documentation Home

Subtract one duration from another.

template <class Rep1, class Period1, class Rep2, class Period2>
typename common_type<duration<Rep1, Period1>, duration<Rep2, Period2>>::type
constexpr operator-(
    const duration<Rep1, Period1>& lhs,
    const duration<Rep2, Period2>& rhs);

Returns:

CommonDuration(CommonDuration(lhs).count() - CommonDuration(rhs).count()), where CommonDuration is a synonym for std::common_type< duration<Rep1, Period1>::type

Header

#include <chrono>

See Also