23 const auto s1 =
static_cast<int64_t
>(val1.sec);
24 const auto s2 =
static_cast<int64_t
>(val2.sec);
25 const auto ns1 =
static_cast<int64_t
>(val1.nsec);
26 const auto ns2 =
static_cast<int64_t
>(val2.nsec);
27 return ::ros::Duration().fromNSec(s1 * s2 * 1000000000LL + s1 * ns2 + s2 * ns1 + (ns1 * ns2) / 1000000000LL);
33 return ::ros::Duration(::sqrt(val.toSec()));
44 const ::ros::WallDuration& val1, const ::ros::WallDuration& val2)
46 const auto s1 =
static_cast<int64_t
>(val1.sec);
47 const auto s2 =
static_cast<int64_t
>(val2.sec);
48 const auto ns1 =
static_cast<int64_t
>(val1.nsec);
49 const auto ns2 =
static_cast<int64_t
>(val2.nsec);
50 return ::ros::WallDuration().fromNSec(s1 * s2 * 1000000000LL + s1 * ns2 + s2 * ns1 + (ns1 * ns2) / 1000000000LL);
56 return ::ros::WallDuration(::sqrt(val.toSec()));