Path: utzoo!utgpu!cunews!bnrgate!brtph3!brchh104!brchs1!bnr.ca!rice.edu!sun-spots-request From: rcomr@koel.co.rmit.oz.au (Mark Rawling) Newsgroups: comp.sys.sun Subject: Accurate time measurements on SS1+, 3/260, etc. Keywords: Hardware Message-ID: <915@brchh104.bnr.ca> Date: 20 Dec 90 06:31:55 GMT Sender: news@brchh104.bnr.ca Organization: Sun-Spots Lines: 31 Approved: Sun-Spots@rice.edu X-Sun-Spots-Digest: Volume 9, Issue 407, message 9 X-Note: Submissions: sun-spots@rice.edu, Admin: sun-spots-request@rice.edu I am trying to make some accurate timing measurements of function call times (user times only). It is intended to have the code monitor itself something like :- ... get_current_time(&start); function_to_be_timed(); get_current_time(&stop); function_time = stop - start; ... The problem is that getrusage is limited to 10mS resolution (on the SS1+, and worse elsewhere). Thus the rusage.ru_utime.tv_usec field is always nn0000 micro-secs. The only thing I can see that is potentially better than this is "time (3V)" which returns a milliseconds field. But of course, this is real time and would require running single user, disabling interrupts, etc. Has anyone looked at this before? Is it possible to up the system clock to 1kHz or higher (temporarily) and still run multiuser? Failing this, is it possible to get something more accurate than uS out of the real time chip and if so how? If all else fails I will have to resort to a sbus/vme - PC interface and read real time from a PC card :-( Can someone *please* save me from this fate! Mark Rawling, CSIRO Division of Information Technology, High Performance Computation Group, c/o Royal Melbourne Institute of Technology, email: rcomr@koel.co.rmit.oz{.au}, phone: (+ 61 3) 660 2726