Devel::DProf Real Elapsed Times
Luc St-Louis [Wed, 17 Apr 2002 14:22:25 +0000 (10:22 -0400)]
Message-ID: <85256B9E.0064EBE9.00@btg_hub01.bombardier.com>

p4raw-id: //depot/perl@15985

win32/win32.c

index a77ec88..325531e 100644 (file)
@@ -1503,22 +1503,21 @@ win32_times(struct tms *timebuf)
     FILETIME user;
     FILETIME kernel;
     FILETIME dummy;
+    clock_t process_time_so_far = clock();
     if (GetProcessTimes(GetCurrentProcess(), &dummy, &dummy,
                         &kernel,&user)) {
        timebuf->tms_utime = filetime_to_clock(&user);
        timebuf->tms_stime = filetime_to_clock(&kernel);
        timebuf->tms_cutime = 0;
        timebuf->tms_cstime = 0;
-
     } else {
         /* That failed - e.g. Win95 fallback to clock() */
-        clock_t t = clock();
-       timebuf->tms_utime = t;
+       timebuf->tms_utime = process_time_so_far;
        timebuf->tms_stime = 0;
        timebuf->tms_cutime = 0;
        timebuf->tms_cstime = 0;
     }
-    return 0;
+    return process_time_so_far;
 }
 
 /* fix utime() so it works on directories in NT */