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;
}
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", time2 - time1);
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", time2 - time1);
return 1;
}
time2 - time1
time1=12345;
time2=12346; 12345-12346=-1 yes ![]() Код:
time2 - time1 edit: aaaw next time i will post before searching a proper picture ^^ |
[22:12:29] test1 took 25 ms to process [22:12:35] test1 took 26 ms to process [22:12:40] test1 took 21 ms to process [22:12:47] test2 took 29 ms to process [22:12:54] test2 took 29 ms to process [22:12:58] test2 took 26 ms to process
if(sscanf(params,"i",id)) return 0;
if(IsNumeric(params)) return 0;
new id = strval(params);
printf("Execution took %dms.", GetTickCount()-iStart);