lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master c0a4dde 04/16: Reliably multiply suseconds_t


From: Greg Chicares
Subject: [lmi-commits] [lmi] master c0a4dde 04/16: Reliably multiply suseconds_t by double
Date: Thu, 15 Nov 2018 17:37:03 -0500 (EST)

branch: master
commit c0a4dde8da779ae5d3aceafdb6fc9746a4a6572a
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Reliably multiply suseconds_t by double
---
 timer.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/timer.cpp b/timer.cpp
index a82bce5..57a6bb8 100644
--- a/timer.cpp
+++ b/timer.cpp
@@ -192,7 +192,10 @@ double Timer::inspect() const
 #if defined LMI_POSIX
     timeval x;
     gettimeofday(&x, nullptr);
-    return x.tv_usec + 1000000.0 * x.tv_sec;
+    return
+                      bourn_cast<double>(x.tv_usec)
+        + 1000000.0 * bourn_cast<double>(x.tv_sec)
+        ;
 #elif defined LMI_MSW
 #   if defined LMI_MS_HEADER_INCLUDED
     LARGE_INTEGER z;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]