* win32/win32.c (clock_gettime): improve precision when freq is less

than and nearly equals 10**9.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2013-08-15 09:41:40 +00:00
Родитель 5cd2fb2ebb
Коммит f653019d55
2 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Thu Aug 15 18:39:31 2013 NAKAMURA Usaku <usa@ruby-lang.org>
* 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 <ko1@atdot.net>
* gc.c (gc_lazy_sweep): remove heap_increment() here because heap_inc

Просмотреть файл

@ -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;