Revision: 77870
          http://sourceforge.net/p/brlcad/code/77870
Author:   starseeker
Date:     2020-12-02 14:35:39 +0000 (Wed, 02 Dec 2020)
Log Message:
-----------
Merge from trunk - r77866 through r77869

Modified Paths:
--------------
    brlcad/branches/extbuild/src/librt/timer.cpp

Property Changed:
----------------
    brlcad/branches/extbuild/

Index: brlcad/branches/extbuild
===================================================================
--- brlcad/branches/extbuild    2020-12-02 14:34:23 UTC (rev 77869)
+++ brlcad/branches/extbuild    2020-12-02 14:35:39 UTC (rev 77870)

Property changes on: brlcad/branches/extbuild
___________________________________________________________________
Modified: svn:mergeinfo
## -11,4 +11,4 ##
 /brlcad/branches/osg:62110-62113
 /brlcad/branches/prep-cache:68236-68933
 /brlcad/branches/tcltk86:68300-75257
-/brlcad/trunk:77547-77865
\ No newline at end of property
+/brlcad/trunk:77547-77869
\ No newline at end of property
Modified: brlcad/branches/extbuild/src/librt/timer.cpp
===================================================================
--- brlcad/branches/extbuild/src/librt/timer.cpp        2020-12-02 14:34:23 UTC 
(rev 77869)
+++ brlcad/branches/extbuild/src/librt/timer.cpp        2020-12-02 14:35:39 UTC 
(rev 77870)
@@ -24,6 +24,7 @@
 #include <chrono>
 #include <sstream>
 #include <iomanip>
+#include "bu/log.h"
 #include "bu/str.h"
 #include "bu/vls.h"
 #include "rt/timer.h"
@@ -31,7 +32,7 @@
 #ifdef HAVE_GETPROCESSTIMES
 static double  time_cpu;       /* Time at which timing started */
 #else
-static clock_t time_cpu;       /* Time at which timing started */
+static std::clock_t time_cpu;  /* Time at which timing started */
 #endif
 static std::chrono::steady_clock::time_point time_wall;
 
@@ -48,7 +49,7 @@
     /* https://stackoverflow.com/a/17440673 */
     time_cpu = (double)(d.dwLowDateTime | ((unsigned long 
long)d.dwHighDateTime << 32)) * 0.0000001;
 #else
-    time_cpu = clock();
+    time_cpu = std::clock();
 #endif
     time_wall = std::chrono::steady_clock::now();
 }
@@ -65,13 +66,13 @@
     double time1 = DBL_MAX;
     if (!GetProcessTimes(GetCurrentProcess(),&a,&b,&c,&d)) {
        bu_log("Warning - could not initialize RT timer!\n");
-       return;
+       return DBL_MAX;
     }
     /* https://stackoverflow.com/a/17440673 */
     time1 = (double)(d.dwLowDateTime | ((unsigned long long)d.dwHighDateTime 
<< 32)) * 0.0000001;
-    user_cpu_secs = time1 - time0;
+    user_cpu_secs = time1 - time_cpu;
 #else
-    clock_t time1 = clock();
+    std::clock_t time1 = std::clock();
     user_cpu_secs = (double)(time1 - time_cpu)/CLOCKS_PER_SEC;
 #endif
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to