Path: chuka.playstation.co.uk!scea!greg_labrec@interactive.sony.com From: "Robert Schutt" Newsgroups: scea.yaroze.programming.gnu_compiler Subject: Re: Timing Code Date: Sun, 12 Apr 1998 22:39:41 -0400 Organization: SCEA News Server Lines: 63 Message-ID: <6grspj$36811@scea> References: <6gllke$3684@scea> <352E6C2C.DACE5289@netmagic.net> NNTP-Posting-Host: 149.43.162.22 X-Newsreader: Microsoft Outlook Express 4.72.2106.4 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Could you be a little more "basic" with your explanation. I'm not terribly familiar with the Playstation architecture. I'm trying to write several programs which demonstrate the features of the R3000 architecture. ie. like instruction pipelining etc. I'm using the Playstation because I don't have access to a MIPS chip other than in the Playstation. I want to time a block of code. Perhaps the actual time to execute an add instruction on the architecture. Perhaps some C code would look like for (i = 0; i < 1000000; i++) a = b + c; The times would probably come out somewhere in 5 -15 seconds. By dividing the time by 1000000 I can get instruction times. I just basically want to get a beginning time and end time. Can you recommend a reference where I may be able to find out about the vsync, etc. Do you still think this would satisfy my problem. -rschutt@cs.colgate.edu Elliott Lee wrote in message <352E6C2C.DACE5289@netmagic.net>... >You could look into using the root counter and check it every once in >a while. > >I use the vsyncs at 1/60 sec. It works okay if you use a fixed-point >vector. (e.g. 0x00000444 * 60 = 0x0000FFF0, that's about a 2.5% >error from 0x00010000.) Actually count the vsyncs to get a 100% accurate >timing, provided that one iteration of your code executes >within 1/60 sec. > >- e! > >cnevison wrote: >> >> Does anyone know how to do timing with the gcc compiler? >> >> The "time.h" file is not supported in the basic CD-ROM >> from yaroze. >> >> I want to be able to obtain times in seconds. Does anyone >> know how to do this? >> >> -rschutt@cs.colgate.edu > >-- >- e! > tenchi@netmagic.net > http://www.netmagic.net/~tenchi/yaroze/