Path: chuka.playstation.co.uk!news From: Developer Support Newsgroups: scea.yaroze.programming.2d_graphics,scee.yaroze.programming.2d_graphics Subject: System timers Date: Wed, 28 May 1997 17:43:32 +0100 Organization: Sony Computer Entertainment Europe Lines: 43 Message-ID: <338C60B4.6490@interactive.sony.com> References: <5mgje6$shk7@scea> <338BF95C.12A@interactive.sony.com> Reply-To: N/A-Use-Newsgroup NNTP-Posting-Host: 194.203.13.10 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.01 (Win95; I) Xref: chuka.playstation.co.uk scea.yaroze.programming.2d_graphics:69 scee.yaroze.programming.2d_graphics:102 Developer Support wrote: > As for system timers there are 3 functions long StartRCnt(unsigned > long), long ResetRCnt(unsigned long) and long GetRCnt(unsigned long). > The only values that do anything in the calls are 0,1 and 2. 0 and 2 > seem to be pixel counts (time to draw a pixel, or of that order, there > isn't much in the way of details on how they were set up), and 1 seems > to be a scanline count. > > To use the root counters just call StartRCnt with the number you want. > ResetRCnt as necessary and GetRCnt to get a value. The value returned is > in the range 0-65535, after which the counters wrap around. > > Example > > #include > > void main() > { > unsigned long counter; > > counter = 0; // could also be 1 or 2 > > StartRCnt(counter); > > while(*program terminate condition*) > { > ResetRCnt(counter); > > *all the code* > > printf("Time taken: %d\n",GetRCnt(counter)); > } > } > > Stuart I've just been told that timer 0 can fail some times, and timer 1 is used internally (VSync(1) uses it, so its best not to reset it). This leaves timer 2, which doesn't seem to have any problems associated with it. Stuart