Advertisement
Johurt

GetPlayerPoolSize test

Jul 6th, 2015
462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.92 KB | None | 0 0
  1. stock j_GetPlayerPoolSize() return 5000000;
  2. #define GetPlayerPoolSize j_GetPlayerPoolSize
  3.  
  4. stock GetSpeedResults()
  5. {
  6.     new a, b = GetPlayerPoolSize(), c, t = GetTickCount();
  7.     for(a = 0; a < b + 1; a++) c++;
  8.     printf("1 ciklas prasuktas per: %d MS", GetTickCount() - t);
  9.     t = GetTickCount();
  10.     for(new i, j = GetPlayerPoolSize (); i <= j; i++) c++;
  11.     printf("2 ciklas prasuktas per: %d MS", GetTickCount() - t);
  12.     a = 0;
  13.     t = GetTickCount();
  14.     for(a = b; a > -1; a--) c++;
  15.     printf("3 ciklas prasuktas per: %d MS", GetTickCount() - t);
  16. }
  17.  
  18. main()
  19. {
  20.     for(new c; c < 3; c++) GetSpeedResults();
  21. }
  22.  
  23. /*
  24.     Rezultatai:
  25.         1 ciklas prasuktas per: 154 MS
  26.         2 ciklas prasuktas per: 133 MS
  27.         3 ciklas prasuktas per: 126 MS
  28.  
  29.         1 ciklas prasuktas per: 146 MS
  30.         2 ciklas prasuktas per: 132 MS
  31.         3 ciklas prasuktas per: 125 MS
  32.  
  33.         1 ciklas prasuktas per: 145 MS
  34.         2 ciklas prasuktas per: 132 MS
  35.         3 ciklas prasuktas per: 125 MS
  36. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement