Revision: 77861
http://sourceforge.net/p/brlcad/code/77861
Author: starseeker
Date: 2020-12-02 01:52:48 +0000 (Wed, 02 Dec 2020)
Log Message:
-----------
Grr. Windows doesn't provide CPU time with clock() - which, if I'm reading
this right, means timer-nt.c is measuring the wrong thing? rt/timer.h says the
timer is supposed to be reporting CPU time... First step is to see if we've
got GetProcessTimes available.
Modified Paths:
--------------
brlcad/trunk/CMakeLists.txt
Modified: brlcad/trunk/CMakeLists.txt
===================================================================
--- brlcad/trunk/CMakeLists.txt 2020-12-02 01:15:45 UTC (rev 77860)
+++ brlcad/trunk/CMakeLists.txt 2020-12-02 01:52:48 UTC (rev 77861)
@@ -2812,6 +2812,20 @@
CONFIG_H_APPEND(BRLCAD "#define HAVE_GETFULLPATHNAME 1\n")
endif(HAVE_GETFULLPATHNAME)
+# If we have GetProcessTimes, we need it instead of clock() for CPU time.
+# https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/clock
+check_c_source_compiles("
+#include <windows.h>
+int main() {
+FILETIME a,b,c,d;
+(void)GetProcessTimes(GetCurrentProcess(),&a,&b,&c,&d);
+return 0;
+}
+" HAVE_GETPROCESSTIMES)
+if(HAVE_GETPROCESSTIMES)
+ CONFIG_H_APPEND(BRLCAD "#define HAVE_GETPROCESSTIMES 1\n")
+endif(HAVE_GETPROCESSTIMES)
+
# GetCurrentProcessId
check_c_source_compiles("
#include <windows.h>
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