HG util time: make sure we round up ms time conversion
@@ -353,9 +353,10 @@ static HG_UTIL_INLINE unsigned int
hg_time_to_ms(hg_time_t tv)
{
#if defined(HG_UTIL_HAS_TIME_H) && defined(HG_UTIL_HAS_CLOCK_GETTIME)
- return (unsigned int) (tv.tv_sec * 1000 + tv.tv_nsec / 1000000);
+ return (
+ unsigned int) (tv.tv_sec * 1000 + ((tv.tv_nsec + 999999) / 1000000));
#else
- return (unsigned int) (tv.tv_sec * 1000 + tv.tv_usec / 1000);
+ return (unsigned int) (tv.tv_sec * 1000 + ((tv.tv_usec + 999) / 1000));
#endif
}
