Advertisement
Guest User

Untitled

a guest
Jun 12th, 2014
391
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. myArray = [];
  2.  
  3. for "_i" from 0 to 1000000 do {
  4.     myArray set [count myArray, _i];
  5. };
  6.  
  7. hint "DONE POPULATING ARRAY";
  8.  
  9. myFunction = {
  10.     [] spawn {
  11.         _startTime = diag_tickTime;
  12.  
  13.         /*
  14.         {
  15.             _tmp = _x;
  16.         } forEach myArray;
  17.         */
  18.        
  19.         /*
  20.         {
  21.             _tmp = _x;
  22.         } count myArray;
  23.         */
  24.        
  25.         for "_i" from 0 to (count myArray - 1) do {
  26.             _tmp = myArray select _i;
  27.         };
  28.  
  29.         _diff = diag_tickTime - _startTime;
  30.         diag_log (str (_diff));
  31.     }
  32. }
  33.  
  34. /*
  35.             unscheduled (blocking engine)       scheduled (not blocking engine)
  36. forEach     1.66449                             5.379515
  37. count       1.2985075                           4.25299
  38. for         1.95398                             6.209015
  39. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement