From: Luc St-Louis Date: Wed, 17 Apr 2002 14:22:25 +0000 (-0400) Subject: Devel::DProf Real Elapsed Times X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=50ee8e5ea1d62ca6b3ab566d75c1f4fbefdc976c;p=p5sagit%2Fp5-mst-13.2.git Devel::DProf Real Elapsed Times Message-ID: <85256B9E.0064EBE9.00@btg_hub01.bombardier.com> p4raw-id: //depot/perl@15985 --- diff --git a/win32/win32.c b/win32/win32.c index a77ec88..325531e 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -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 */