Commit edc060cf authored by Cédric Traizet's avatar Cédric Traizet
Browse files

BUG: use long long to store integer number of nanoseconds, as long might not...

BUG: use long long to store integer number of nanoseconds, as long might not be enough when it is stored on 32 bits
parent 4ad8c56c
Pipeline #8078 failed with stages
in 82 minutes and 26 seconds
...@@ -130,15 +130,15 @@ public: ...@@ -130,15 +130,15 @@ public:
static Duration Seconds(double d) static Duration Seconds(double d)
{ {
return Duration(boost::posix_time::nanoseconds(static_cast<long>(std::round(d * 1e9)))); return Duration(boost::posix_time::nanoseconds(static_cast<long long>(std::round(d * 1e9))));
} }
static Duration Nanoseconds(double d) static Duration Nanoseconds(double d)
{ {
return Duration(boost::posix_time::nanoseconds(static_cast<long>(std::round(d)))); return Duration(boost::posix_time::nanoseconds(static_cast<long long>(std::round(d))));
} }
Duration(double d): m_Duration(boost::posix_time::nanoseconds(static_cast<long>(std::round(d)))) {} Duration(double d): m_Duration(boost::posix_time::nanoseconds(static_cast<long long>(std::round(d)))) {}
double TotalNanoseconds() const double TotalNanoseconds() const
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment