Sporkinator

Benchmark Test

Dec 30th, 2011
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Slow code, with execute_string()
  2. var time;
  3. time = current_time;
  4. repeat (64)
  5. {
  6.     execute_string("bld = instance_create(random(room_width) div 1, random(room_height) div 1, obj_blood);
  7.     bld.image_xscale = 0.7;
  8.     bld.image_yscale = 0.7;
  9.     bld.direction = - 90;");
  10. }
  11. show_message("This slow code took " + string(current_time - time) + " milliseconds");
  12.  
  13. //Fast code, without execute_string();
  14. var time;
  15. time = current_time;
  16. repeat (64)
  17. {
  18.     bld = instance_create(random(room_width) div 1, random(room_height) div 1, obj_blood);
  19.     bld.image_xscale = 0.7;
  20.     bld.image_yscale = 0.7;
  21.     bld.direction = - 90;
  22. }
  23. show_message("This fast code took " + string(current_time - time) + " milliseconds");
Advertisement
Add Comment
Please, Sign In to add comment