diff --git a/include/boost/interprocess/sync/posix/timepoint_to_timespec.hpp b/include/boost/interprocess/sync/posix/timepoint_to_timespec.hpp index 297fe8a..956fd5b 100644 --- a/include/boost/interprocess/sync/posix/timepoint_to_timespec.hpp +++ b/include/boost/interprocess/sync/posix/timepoint_to_timespec.hpp @@ -73,7 +73,7 @@ inline timespec timepoint_to_timespec ( const TimePoint &tm const double factor = double(duration_t::period::num)/double(duration_t::period::den); const double res = d.count()*factor; ts.tv_sec = static_cast(res); - ts.tv_nsec = static_cast(res - double(ts.tv_sec)); + ts.tv_nsec = static_cast(1000000000.0*(res - double(ts.tv_sec))); } return ts; }