ruby-changes:30483
From: usa <ko1@a...>
Date: Thu, 15 Aug 2013 18:41:48 +0900 (JST)
Subject: [ruby-changes:30483] usa:r42562 (trunk): * win32/win32.c (clock_gettime): improve precision when freq is less
usa 2013-08-15 18:41:40 +0900 (Thu, 15 Aug 2013) New Revision: 42562 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42562 Log: * win32/win32.c (clock_gettime): improve precision when freq is less than and nearly equals 10**9. Modified files: trunk/ChangeLog trunk/win32/win32.c Index: ChangeLog =================================================================== --- ChangeLog (revision 42561) +++ ChangeLog (revision 42562) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Aug 15 18:39:31 2013 NAKAMURA Usaku <usa@r...> + + * 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@a...> * gc.c (gc_lazy_sweep): remove heap_increment() here because heap_inc Index: win32/win32.c =================================================================== --- win32/win32.c (revision 42561) +++ win32/win32.c (revision 42562) @@ -4339,7 +4339,7 @@ clock_gettime(clockid_t clock_id, struct https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L4339 } 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; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/