[m-dev.] diff: mercury_timing.c
Peter Ross
peter.ross at miscrit.be
Fri Sep 1 22:50:22 AEDT 2000
Hi,
===================================================================
Estimated hours taken: 0.1
runtime/mercury_timing.c:
Fix a bug where under Windows the UNIX version of
MR_get_user_cpu_miliseconds was being selected.
Index: mercury_timing.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_timing.c,v
retrieving revision 1.5
diff -u -r1.5 mercury_timing.c
--- mercury_timing.c 2000/07/04 12:39:00 1.5
+++ mercury_timing.c 2000/09/01 11:47:08
@@ -26,9 +26,8 @@
int
MR_get_user_cpu_miliseconds(void)
{
-#ifndef MR_CLOCK_TICKS_PER_SECOND
- #ifdef MR_WIN32_GETPROCESSTIMES
- #define FILETIME_TO_MILLISEC(time, msec) \
+#ifdef MR_WIN32_GETPROCESSTIMES
+ #define FILETIME_TO_MILLISEC(time, msec) \
do \
{ \
SYSTEMTIME tmp; \
@@ -49,10 +48,8 @@
FILETIME_TO_MILLISEC(user_time, user_msec);
FILETIME_TO_MILLISEC(kernel_time, kernel_msec);
return user_msec + kernel_msec;
- #else
- return -1;
- #endif
-#else
+#elif HAVE_SYS_TIMES_H
+ #ifdef MR_CLOCK_TICKS_PER_SECOND
const double ticks_per_milisecond = MR_CLOCK_TICKS_PER_SECOND / 1000.0;
struct tms t;
@@ -60,5 +57,10 @@
return -1;
}
return (int) (t.tms_utime / ticks_per_milisecond);
+ #else
+ return -1;
+ #endif
+#else
+ return -1;
#endif
}
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list