This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: time functions


Daniel P. Siu[SMTP:dps@micro-mono.com] 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 - colin@bird.fu.is.saga-u.ac.jp
-- 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
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]