This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project. See the Cygwin home page for more information.
[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

Re: B20.1 clock() function bug?



In a message dated 1/30/99 1:28:38 AM Pacific Standard Time,
Brian.P.Kasper@notes.aero.org writes:

<<   The clock function,s era begins (with a value of 0) when the
   C program starts to execute.>>

I don't think you can count on that.  It should return a value of type
clock_t, which overflows and starts over periodically.

<<   It returns times measured in 1/CLOCKS_PER_SEC (which
   equals 1/1000 for Microsoft C).>>

Always use the local CLOCK_T.  Who knows when it might change or when you
might use a different brand of software.
 
<< Am I misinterpreting the behavior of clock()?  Does it return
 user time instead of absolute system time? >>

Read your C textbook.  That's what it should do, at least on NT.  On W95, this
is not possible, and maybe M$ has set up the NT version for compatibility with
W95.  BTW, the last time I checked clock() (prior to B20.1) it didn't work on
W95, so you have to use something based on QueryPerformance calls.  I'll look
into this.

 
 <<FWIW, I searched the mailing list archives and found no references to
 possible bugs in clock(). >>

I'm no archives expert, but I do recall discussing this, although the focus
was on the g77 version.

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".