[project @ 2002-07-16 12:05:37 by simonmar]
[ghc-hetmet.git] / ghc / rts / Stats.c
index 3eb5631..5052e26 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Stats.c,v 1.41 2001/11/28 14:29:59 simonmar Exp $
+ * $Id: Stats.c,v 1.44 2002/02/06 01:21:40 sof Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -579,17 +579,19 @@ stat_endHeapCensus(void)
    stats for this thread into the task_ids struct for that thread.
    -------------------------------------------------------------------------- */
 
-#ifdef SMP
+#if defined(SMP)
 void
 stat_workerStop(void)
 {
     nat i;
     pthread_t me = pthread_self();
 
+    getTimes();
+
     for (i = 0; i < RtsFlags.ParFlags.nNodes; i++) {
        if (task_ids[i].id == me) {
-           task_ids[i].mut_time = usertime() - task_ids[i].gc_time;
-           task_ids[i].mut_etime = elapsedtime()
+           task_ids[i].mut_time = CurrentUserTime - task_ids[i].gc_time;
+           task_ids[i].mut_etime = CurrentElapsedTime
                - GCe_tot_time
                - task_ids[i].elapsedtimestart;
            if (task_ids[i].mut_time < 0.0)  { task_ids[i].mut_time = 0.0;  }
@@ -599,6 +601,14 @@ stat_workerStop(void)
 }
 #endif
 
+#if defined(SMP)
+long int stat_getElapsedTime ()
+{
+  getTimes();
+  return CurrentElapsedTime;
+}
+#endif
+
 /* -----------------------------------------------------------------------------
    Called at the end of execution