SA-MP Forums Archive
Timer and CPU/RAM Load statistic - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Timer and CPU/RAM Load statistic (/showthread.php?tid=610167)



Timer and CPU/RAM Load statistic - AaronJ - 20.06.2016

Hi all!

The timers, use more CPU or more RAM? I imagine CPU..

So..

If i would run a cycle like the following (is an example written now):

Код:
DoCheck(playerid)
{
    new Float:x, Float:y, Float:z;
    new Float:m, Float:n, Float:o;
    GetPlayerPos(playerid, x, y, z);

    foreach(Player, i)
    {
        GetPlayerPos(i,m,n,o)
        if (m <= x)
        {
    	    // DO SOMETHING //
        }
    }
}
each 500ms or 1s...

How many this would impact on the server resources?

Regardsss


Re: Timer and CPU/RAM Load statistic - TwinkiDaBoss - 20.06.2016

It depends from server to server. Every script is different and there will be a different CPU, RAM usage for everything.
Run the code and see it yourself.


Re: Timer and CPU/RAM Load statistic - AaronJ - 21.06.2016

Is just an idea now.. I need a lot of code to reach this point.. Let's see when i do it