1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
parent 5cd2fb2ebb
commit f653019d55
2 changed files with 6 additions and 1 deletions

View file

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

View file

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