Mail Archives: cygwin/2003/10/14/14:05:01
On Tue, 14 Oct 2003, Alex Vinokur wrote:
> # ------ man clock (fragments) ------
> # RETURNS
> # The amount of processor time used so far by your program, in units
> # defined by the machine-dependent macro `CLOCKS_PER_SEC'.
> # If no measurement is available, the result is `-1'.
>
> So, clock() is unsigned and never returns -1 (?!)
>
> If one must write
> ----------------------------------
> if (!(clock () == (clock_t)(-1)));
> ----------------------------------
> I think it is worth noting that in the manual.
The above is always good practice anyway. Besides, it seems they do it
this way in a few other places as well:
<http://www.hmug.org/man/3/clock.html>
<http://www.rocketaware.com/man/man3/clock.3.htm>
<http://developer.apple.com/documentation/Darwin/Reference/ManPages/html/clock.3.html>
<http://www-sbras.nsc.ru/cgi-bin/www/unix_help/unix-man?clock+3>
<http://pluto.iis.nsk.su/cgi-bin/man-cgi?clock+3>
IOW, this is not Cygwin specific. FWIW, you're welcome to submit a patch
to the cygwin-doc package.
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster." -- Patrick Naughton
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -