Does times() work on SUN's properly ?

Bruce Worden bruce at seismo.gps.caltech.edu
Fri Aug 17 04:36:06 AEST 1990


In article <1990Aug16.190428.1 at csc.fi> sbs at csc.fi writes:
>I have problem on our SUN/3 or SUN/4 that I cannot get correct elapsed
>time (real time, wall clock time) from function times(). Following
>code works on Cray/UNICOS and Iris-4D (under SYSTEM V):

> [code deleted]

>And I will get that elapsed time (variable e) is equal to zero on our SUNs. 
>What is going wrong here (on SUN)?

The problem appears to be that you are using the /usr/ucb cc, whose 
times() call returns 0 on success or -1 on failure.  If you want to 
use times() as you have it here, you can use the cc in /usr/5bin, which 
uses the sysV libraries and works the way you want. 
--------------------------------------------------------------------------
Bruce Worden                            bruce at seismo.gps.caltech.edu
252-21 Seismological Laboratory, Caltech, Pasadena, CA 91125
--------------------------------------------------------------------------



More information about the Comp.lang.c mailing list