Frames per Second

Started by
0 comments, last by lazer_hassing 22 years, 10 months ago
Just a small question: Could I get the current FPS of my game by doing this in the main loop?

// 'tps' is set using 'QueryPerformanceFrequency(&tps);'
QueryPerformanceCounter(&ct);
fps = (float)tps.QuadPart / (float)(ct.QuadPart - lt.QuadPart);
QueryPerformanceCounter(& lt);
 
--Lasse Hassing "...be a slave in heaven or a star in hell..." Edited by - lazer_hassing on June 23, 2001 6:35:29 AM
Advertisement
You might want to change it to
QueryPerformanceCounter(&ct);fps = (float)tps.QuadPart / (float)(ct.QuadPart - lt.QuadPart);lt = ct; 

otherwise, yep.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara

This topic is closed to new replies.

Advertisement