Subject: RE: time functions
From: [email-masked] (Colin Peters)

5 Jun 1997 03:15:26 -0700
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <01BC71B8.42A71AA0.cygnus.gnu-win32@gbird0>
Original-To: "[email-masked]'" <[email-masked]>
Original-Cc: "'GNU-Win32'" <[email-masked]>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Original-Sender: [email-masked]

Daniel P. Siu[SMTP:[email-masked]] wrote:
>I just got started with gnu-win32 (w95).  I encountered strange results
>with the 'times' library function (I know, this is obsolete but I also
>encountered strange though different results with the 'getrusage' system
>call).  'times' calls return should return number of 'CLK_TCK' since
>invocation of the current process.  Instead it returns very big numbers
>(millions).
>
[snip]
>
>This works fine under f2c or g77 and many Unix systems including Linux
>and Solaris but gives strange under g77 and gnu-win32.

Just a suspicion on my part, but it's possible that the GNU-Win32
implementation uses GetProcessTimes or GetThreadTimes to calculate
the values to pass back through times(). According to a book I have,
these functions are not implemented in Windows 95 (and it says there
is no reliable way of getting such times under Windows 95, although
I remember someone mentioning a "close enough" solution once).
Probably the GNU-Win32 implementation is not checking the return
value (or is returning some sort of error indication but your code
is unaware of it) and the user and system times are simply garbage.

If possible run your program on NT. It may work over there.

For the GNU-Win32 people this is yet another hassle they will have
to deal with if they want to get something that works under Windows
95.

Colin.

-- Colin Peters - [email-masked]
-- Saga University Dept. of Information Science
-- http://www.fu.is.saga-u.ac.jp/~colin/index.html
-- http://www.geocities.com/Tokyo/Towers/6162/

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".