//Slow code, with execute_string()
var time;
time = current_time;
repeat (64)
{
execute_string("bld = instance_create(random(room_width) div 1, random(room_height) div 1, obj_blood);
bld.image_xscale = 0.7;
bld.image_yscale = 0.7;
bld.direction = - 90;");
}
show_message("This slow code took " + string(current_time - time) + " milliseconds");
//Fast code, without execute_string();
var time;
time = current_time;
repeat (64)
{
bld = instance_create(random(room_width) div 1, random(room_height) div 1, obj_blood);
bld.image_xscale = 0.7;
bld.image_yscale = 0.7;
bld.direction = - 90;
}
show_message("This fast code took " + string(current_time - time) + " milliseconds");
Comments