summaryrefslogtreecommitdiff
path: root/win32/win32.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-15 09:41:40 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-15 09:41:40 +0000
commitf653019d55092cfce380bd6631468ad261105032 (patch)
tree126de052f57249566176f65e923008c52fa78dc5 /win32/win32.c
parent5cd2fb2ebbedf5fd0fd12fd3a5d4a90bcbe2dca3 (diff)
* 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
Diffstat (limited to 'win32/win32.c')
-rw-r--r--win32/win32.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 95e2010..c64b7b9 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;