Article View: comp.sys.sun
Article #6210Re: Accurate time measurements on SS1+, 3/260, etc.
From: Jim Kohli
Date: Sun, 30 Dec 1990 01:04
Date: Sun, 30 Dec 1990 01:04
31 lines
1659 bytes
1659 bytes
In article <915@brchh104.bnr.ca>, rcomr@koel.co.rmit.oz.au (Mark
Rawling) writes:
<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.
It is not unusual to do something like this:
...
get_current_time(&start);
for( i=0 ; i<1000 ; i++ ) function_to_be_timed();
get_current_time(&stop);
function_time = (float)(stop - start)/1000.0;
...
Jim Kohli
GE Medical
Technical Details
Message-ID:
<941@brchh104.bnr.ca>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!cunews!bnrgate!brtph3!brchh104!brchs1!bnr.ca!rice.edu!sun-spots-requestShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cunews!bnrgate!brtph3!brchh104!brchs1!bnr.ca!rice.edu!sun-spots-request From: mrsvr!gemed.kohli@uwm.edu (Jim Kohli) Newsgroups: comp.sys.sun Subject: Re: Accurate time measurements on SS1+, 3/260, etc. Keywords: Miscellaneous Message-ID: <941@brchh104.bnr.ca> Date: 30 Dec 90 01:04:00 GMT Sender: news@brchh104.bnr.ca Organization: Sun-Spots Lines: 31 Approved: Sun-Spots@rice.edu X-Original-Date: 21 Dec 90 22:50:15 GMT X-Refs: Original: v9n407 X-Sun-Spots-Digest: Volume 9, Issue 411, message 8 X-Note: Submissions: sun-spots@rice.edu, Admin: sun-spots-request@rice.edu