It would just print out "diff = 0.000"
Whats wrong?
Code:
public plugin_init() {
register_plugin("test", "1.00", "[ --<-@ ]")
set_task(1.0, "test")
}
public test() {
start_timer()
new text1[32]
new i_file = fopen("addons/amxmodx/test.txt", "r");
new i_file2 = fopen("addons/amxmodx/result1.txt", "w");
if ( ! i_file )
return;
while ( ! feof(i_file) ) {
fgets(i_file, text1, 31);
fprintf(i_file2, "%s", text1)
}
fclose(i_file);
fclose(i_file2);
stop_timer()
}
new Float:start, Float:stop
public start_timer()
start = get_gametime()
public stop_timer() {
stop = get_gametime()
new Float:diff = floatsub(start, stop)
server_print("diff = %f", diff)
}