1 -
Time taken to run SendClientMessage 81 milliseconds
Time taken to run SendClientMessage with format 117 milliseconds
OBS:I recommend running the script that you would like to test on a server with nothing, and one test at a time, anything in the background can disrupt the result.
2 - I recommend you use your gamemode variables to save, save the information only when the player leaves your server. And again, use mysql_tquery
2? Another tip, do not spend your time saving string on your server, but avoid use giant strings without any need.
Code:
CMD:speedtest(playerid) {
? ? new var, string[20];
? ? var = GetTickCount();
? ? for(new i; i < 100000; i) {//it has to be several times because these functions run very fast, to be more precise I increase the number of times
? ? ? ? SendClientMessage(playerid, -1, "Bem vindo ao Brasil.");
? ? }
? ? printf("Time taken to run SendClientMessage %d milliseconds", GetTickCount() - var);
? ? var = GetTickCount();
? ? for(new i; i < 100000; i) {
? ? ? ? format(string, sizeof(string), "Bem vindo ao Brasil");
? ? ? ? SendClientMessage(playerid, -1, string);
? ? }
? ? printf("Time taken to run SendClientMessage with format %d milliseconds", GetTickCount() - var);
? ? return 1;
}
Time taken to run SendClientMessage 81 milliseconds
Time taken to run SendClientMessage with format 117 milliseconds
OBS:I recommend running the script that you would like to test on a server with nothing, and one test at a time, anything in the background can disrupt the result.
2 - I recommend you use your gamemode variables to save, save the information only when the player leaves your server. And again, use mysql_tquery
2? Another tip, do not spend your time saving string on your server, but avoid use giant strings without any need.
Code:
Discord: Marllun#6297