Accurate time measurements on SS1+, 3/260, etc.

Mark Rawling rcomr at koel.co.rmit.oz.au
Thu Dec 20 17:31:55 AEST 1990


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 at koel.co.rmit.oz{.au}, phone: (+ 61 3) 660 2726



More information about the Comp.sys.sun mailing list