Works fine. You must've done something wrong.
Code:
#include <amxmodx>
#define TimerMinutes(%0) ( %0 / 60000 % 60 )
#define TimerSeconds(%0) ( %0 / 1000 % 60 )
#define TimerMilliseconds(%0) ( %0 % 1000 )
#define loop (1000000) // 1 m
public plugin_init() {
register_plugin("Get Speed value" , "0.1" , "Freezo" )
register_concmd("get_speed","getSpeedvalue");
}
public getSpeedvalue(id)
{
new timer1, timer2, timer3, i;
new strCheck[23];
timer1 = tickcount();
for (i = 0; i < loop; i++){
format(strCheck, charsmax (strCheck) , "This is test must work" )
//client_print( id , print_chat , strCheck )
}
timer2 = tickcount();
for (i = 0; i < loop; i++){
formatex(strCheck, charsmax (strCheck) , "This is test must work" )
//client_print( id , print_chat , strCheck )
}
timer3 = tickcount();
server_print("1st method run in : %s | 2st method run in : %s", TimerConvert( timer2 - timer1 ) , TimerConvert( timer3 - timer2 ) );
}
stock TimerConvert( timer ) { new iTime[20]; formatex(iTime, charsmax (iTime) , "%d:%02d:%03d", TimerMinutes(timer) , TimerSeconds(timer) , TimerMilliseconds(timer)); return iTime; }
Code:
1st method run in : 0:00:102 | 2st method run in : 0:00:080
__________________