From f653019d55092cfce380bd6631468ad261105032 Mon Sep 17 00:00:00 2001 From: usa Date: Thu, 15 Aug 2013 09:41:40 +0000 Subject: * 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 --- win32/win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'win32') 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; -- cgit v1.2.3