kolibrios-gitea/programs/network/htmlv/browser/include/fps.h--
lev 91c643be8c added sources of HTMLv with named colors and italic text support
git-svn-id: svn://kolibrios.org@1971 a494cfbc-eb01-0410-851d-a64ba20cac60
2011-06-25 01:52:11 +00:00

52 lines
840 B
Plaintext

int GetTime()
{
$mov eax, 26;
$mov ebx, 9;
$int 0x40;
return EAX;
}
/*******************************************************************************
ÔÓÍÊÖÈß ÎÏÐÅÄÅËÅÍÈß FPS
x,y - êîîðäèíàòû âûâîäà FPS íà îêíî
âîçâðàùàåò âðåìÿ â ñîòûõ äîëÿõ ñåêóíäû çàòðà÷èâàåìîå íà 1 öèêë
*/
int time1=0;
int time2=0;
int fps1=0;
int timerend=0;
int FPS()
{
int tr;
time1=GetTime();
if (timerend==0)
{
time2=time1;
timerend=time1;
}
tr = time1 - timerend;
if (time1 - time2 < 100) //åñëè ïðîøëî ìåíåå 1 ñåêóíäû
{ //óâåëè÷èâàåì ñ÷åò÷èê fps
fps1++;
}
else
{
//âûâîäèì ÷èñëî fps
DrawTitle(IntToStr(fps1));
fps1=0;
time2=time1;
}
timerend=time1;
return tr;
}
//******************************************************************************