Advertisement
Guest User

Untitled

a guest
May 9th, 2017
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /// @desc scr_timer_set()
  2.  
  3. gml_pragma("forceinline");
  4.  
  5. global.code_timer = get_timer();
  6.  
  7. ------------------------------------------------------------------------------------------------------------------------------------------
  8.  
  9. /// @desc scr_timer_get()
  10.  
  11. gml_pragma("forceinline");
  12.  
  13. return string(get_timer()-global.code_timer);
  14.  
  15. ------------------------------------------------------------------------------------------------------------------------------------------
  16.  
  17. // THIS IS AN EXAMPLE BUT CAN BE USED AS CODE
  18.  
  19. scr_timer_set() // Set our timer
  20.  
  21. // Do some basic comparison work 100,000 times
  22. repeat(100000)
  23. {
  24.     if ( a < c )
  25.     {
  26.         a += b;
  27.     }
  28. }
  29.  
  30. var time_result = scr_timer_get(); // Get how much time has passed in microseconds
  31.  
  32. show_debug_message(time_result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement