Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!samsung!usc!jarthur!nntp-server.caltech.edu!seismo.gps.caltech.edu!bruce From: bruce@seismo.gps.caltech.edu (Bruce Worden) Newsgroups: comp.lang.c Subject: Re: Does times() work on SUN's properly ? Keywords: System V, real time Message-ID: <1990Aug16.183606.6753@laguna.ccsf.caltech.edu> Date: 16 Aug 90 18:36:06 GMT References: <1990Aug16.190428.1@csc.fi> Sender: bruce@seismo.gps.caltech.edu (Bruce Worden) Organization: California Institute of Technology, CA Lines: 18 In article <1990Aug16.190428.1@csc.fi> sbs@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@seismo.gps.caltech.edu 252-21 Seismological Laboratory, Caltech, Pasadena, CA 91125 --------------------------------------------------------------------------