Example #1
0
void Host_Frame (float time)
{
	double	time1, time2;
	static double	timetotal;
	static int		timecount;
	int		i, c, m;

	if (!serverprofile.value)
	{
		_Host_Frame (time);
		return;
	}
	
	time1 = Sys_FloatTime ();
	_Host_Frame (time);
	time2 = Sys_FloatTime ();	
	
	timetotal += time2 - time1;
	timecount++;
	
	if (timecount < 1000)
		return;

	m = timetotal*1000/timecount;
	timecount = 0;
	timetotal = 0;
	c = 0;
	for (i=0 ; i<svs.maxclients ; i++)
	{
		if (svs.clients[i].active)
			c++;
	}

	Con_Printf ("serverprofile: %2i clients %2i msec\n",  c,  m);
}
Example #2
0
void
Host_Frame(float time)
{
   static int timecount;
   int i, c;

   if (!serverprofile.value)
   {
      _Host_Frame(time);
      return;
   }

   _Host_Frame(time);

   timecount++;

   if (timecount < 1000)
      return;

   timecount = 0;
   c = 0;
   for (i = 0; i < svs.maxclients; i++)
   {
      if (svs.clients[i].active)
         c++;
   }
}
Example #3
0
File: host.cpp Project: TeamNyx/gdk
void Host_Frame (float time)
{
	double	time1, time2;
	static double	timetotal, timetotal_acc;
	static int		timecount, timecount_acc;
	int		i, c, m, m_acc;

	if (!serverprofile.value)
	{
		_Host_Frame (time);
		return;
	}

	time1 = Sys_FloatTime ();
	_Host_Frame (time);
	time2 = Sys_FloatTime ();

	timetotal += time2 - time1;
	timecount++;

	if (timecount < 1000)
		return;

        timetotal_acc += timetotal;
        timecount_acc += timecount;
        m = (int) (timetotal*10000/timecount);
	m_acc = (int) (timetotal_acc*10000/timecount_acc);
	timecount = 0;
	timetotal = 0;
	c = 0;
	for (i=0 ; i<svs.maxclients ; i++)
	{
		if (svs.clients[i].active)
			c++;
	}

	Con_Printf ("serverprofile: %2i clients %2i msec\n",  c,  m/10);
   LOGI("serverprofile: %2i clients %2i.%1i msec, acc = %2i.%1i msec\n",  c,  m/10, m%10, m_acc/10, m_acc%10);
}