16.02.2013, 20:40
Hello, I'm trying to time some code to see which is faster. When i do it this way it returns a negative number.. Is this supposed to happen?
pawn Код:
CMD:test1(playerid, params[])
{
new time1 = GetTickCount();
new id;
if(sscanf(params,"i",id)) return 0;
for(new i = 0; i < 10000; i++) SendClientMessage(playerid, -1, "the big brown fox jumped over a hippo and a cow.");
new time2 = GetTickCount();
printf("test1 took %d ms to process", time1 - time2);
return 1;
}
CMD:test2(playerid, params[])
{
new time1 = GetTickCount();
if(sscanf(params,"i",params[0])) return 0;
for(new i = 0; i < 10000; i++) SendClientMessage(playerid, -1, "the big brown fox jumped over a hippo and a cow.");
new time2 = GetTickCount();
printf("test2 took %d ms to process", time1 - time2);
return 1;
}