[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Optimized gcc 4.3.0 build on Windows returns 0 secs for all time val
From: |
dhruva |
Subject: |
Re: Optimized gcc 4.3.0 build on Windows returns 0 secs for all time values of system-process-attributes |
Date: |
Thu, 1 Jan 2009 18:27:54 +0530 |
I have a shorter patch, not sure it if catches all use cases. I see
non zero results but will confirm if this is the right fix but
comparing the results with optimized with my change and non optimized
build with out my change.
-dhruva
=== modified file 'src/w32.c'
--- src/w32.c 2008-12-20 02:50:35 +0000
+++ src/w32.c 2009-01-01 12:46:37 +0000
@@ -2739,15 +2739,17 @@
}
static FILETIME utc_base_ft;
-static long double utc_base;
+static LONGLONG utc_base;
static int init = 0;
-static long double
+static LONGLONG
convert_time_raw (FILETIME ft)
{
- return
- (long double) ft.dwHighDateTime
- * 4096.0L * 1024.0L * 1024.0L + ft.dwLowDateTime;
+ LARGE_INTEGER tmp_var;
+ tmp_var.LowPart = ft.dwLowDateTime;
+ tmp_var.HighPart = ft.dwHighDateTime;
+
+ return tmp_var.QuadPart * 4096.0L * 1024.0L * 1024.0L;
}
static time_t
@@ -3777,9 +3779,9 @@
double *pcpu;
{
FILETIME ft_creation, ft_exit, ft_kernel, ft_user, ft_current;
- long ctime_sec, ctime_usec, stime_sec, stime_usec, utime_sec, utime_usec;
- long etime_sec, etime_usec;
- long double tem1, tem2, tem;
+ LONGLONG ctime_sec, ctime_usec, stime_sec, stime_usec, utime_sec, utime_usec;
+ LONGLONG etime_sec, etime_usec;
+ LONGLONG tem1, tem2, tem;
if (!h_proc
|| !get_process_times_fn
-dhruva
--
Contents reflect my personal views only!
- Re: Optimized gcc 4.3.0 build on Windows returns 0 secs for all time values of system-process-attributes,
dhruva <=
Re: Optimized gcc 4.3.0 build on Windows returns 0 secs for all time values of system-process-attributes, Juanma Barranquero, 2009/01/01