Path: chuka.playstation.co.uk!news From: "Alex Herbert" Newsgroups: scee.yaroze.beginners Subject: Re: F.P.S. Date: Sun, 31 Jan 1999 18:02:02 -0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 28 Message-ID: <79264i$6fv7@chuka.playstation.co.uk> References: <78vmsl$6fv1@chuka.playstation.co.uk> NNTP-Posting-Host: th-usr02-40.ndirect.co.uk X-Newsreader: Microsoft Outlook Express 4.72.3110.1 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Rikki Prince wrote in message <78vmsl$6fv1@chuka.playstation.co.uk>... >Can anyone tell me, or give me a code snippet for how to calculate how many >frames per second a game is running at? > >Thanks in advance >Rikki > > I think this will work. Call fps() in your main loop just after VSync(0). void fps(void) { static int previous; int now, fps; now=VSync(-1); // VSyncs since program start fps=50/(now-previous); // for PAL. use 60/(now-previous) for NTSC FntPrint("FPS: %d\n",fps); previous=now; } Herbs