I have Codded this function to easy get FPS from any Game/System!
Note: this can be ported or used on any lang and Platform with little tweaking
[HIDE][HASHTAG]#include[/HASHTAG]
float FramesPerSecond = 0;
float FrameCounter = 0;
int FPS_30 = 4; //for 30 Frames per second output
int FPS_60 = 2; //for 60 Frames per second output
int LastTime = 0;
float Read_SYS_FPS()
{
time_t TimePointer;
int CurrentTime = time(&TimePointer);
if (LastTime != CurrentTime)
{
LastTime = CurrentTime;
FramesPerSecond = FrameCounter;
FrameCounter = 0;
}
else
{
FrameCounter++;
}
return FramesPerSecond / FPS_30;
}
[/HIDE]