diff --git a/ChangeLog b/ChangeLog index 1258a0260d..eb1bdae39a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Aug 15 18:39:31 2013 NAKAMURA Usaku + + * win32/win32.c (clock_gettime): improve precision when freq is less + than and nearly equals 10**9. + Thu Aug 15 17:43:15 2013 Koichi Sasada * gc.c (gc_lazy_sweep): remove heap_increment() here because heap_inc diff --git a/win32/win32.c b/win32/win32.c index 95e201092b..c64b7b99e3 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -4339,7 +4339,7 @@ clock_gettime(clockid_t clock_id, struct timespec *sp) } sp->tv_sec = count.QuadPart / freq.QuadPart; if (freq.QuadPart < 1000000000) - sp->tv_nsec = (count.QuadPart % freq.QuadPart) * (1000000000 / freq.QuadPart); + sp->tv_nsec = (count.QuadPart % freq.QuadPart) * 1000000000 / freq.QuadPart; else sp->tv_nsec = (long)((count.QuadPart % freq.QuadPart) * (1000000000.0 / freq.QuadPart)); return 0;