Advertisement
Guest User

Untitled

a guest
Oct 18th, 2013
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.58 KB | None | 0 0
  1. #include <a_samp>
  2. #include <YSI\y_iterate>
  3. #include <aINC\a_bucles>
  4.  
  5. #define INTERACCIONES 5000
  6.  
  7. new Bucle:a_bucles<INTERACCIONES>;
  8. new Iterator:y_iterator<INTERACCIONES>;
  9.  
  10. public OnFilterScriptInit()
  11. {
  12.     //Variable contenedora del tiempo
  13.     new tiempo;
  14.  
  15.     // Agregar valores
  16.     printf("\n\n");
  17.  
  18.         // a_bucles
  19.     tiempo = GetTickCount();
  20.     for(new i = 0; i < INTERACCIONES; i+=1)
  21.     {
  22.         forAg(a_bucles, i);
  23.     }
  24.  
  25.     printf("agregar >> a_bucles   >> "#INTERACCIONES" interacciones >> %d milisegundos", GetTickCount()-tiempo);
  26.  
  27.         // y_iterator
  28.     tiempo = GetTickCount();
  29.     for(new i = 0; i < INTERACCIONES; i+=1)
  30.     {
  31.         Iter_Add(y_iterator, i);
  32.     }
  33.     printf("agregar >> y_iterator >> "#INTERACCIONES" interacciones >> %d milisegundos", GetTickCount()-tiempo);
  34.  
  35.     // Recorrido
  36.     printf("\n\n");
  37.  
  38.         // a_bucles
  39.     tiempo = GetTickCount();
  40.     forEach(i, a_bucles)
  41.     {
  42.         for(new a = 0; a < 1000; a++){}
  43. //      printf("recorrido %i", i);
  44.         #pragma unused i
  45.     }
  46.  
  47.     printf("recorrer >> a_bucles   >> "#INTERACCIONES" interacciones >> %d milisegundos", GetTickCount()-tiempo);
  48.  
  49.         // y_iterator
  50.     tiempo = GetTickCount();
  51.     foreach(new w : y_iterator)
  52.     {
  53.         for(new a = 0; a < 1000; a++){}
  54. //      printf("recorrido %i", w);
  55.         #pragma unused w
  56.     }
  57.  
  58.     printf("recorrer >> y_iterator >> "#INTERACCIONES" interacciones >> %d milisegundos", GetTickCount()-tiempo);
  59.  
  60.     // Valores al azar
  61.     printf("\n\n");
  62.  
  63.         // a_bucles
  64.     tiempo = GetTickCount();
  65.     for(new i = 0; i < INTERACCIONES; i++)
  66.     {
  67.         new azar = forAz(a_bucles);
  68.         #pragma unused azar
  69.     }
  70.  
  71.     printf("azar    >> a_bucles   >> "#INTERACCIONES" interacciones >> %d milisegundos", GetTickCount()-tiempo);
  72.  
  73.         // y_iterator
  74.     tiempo = GetTickCount();
  75.     for(new i = 0; i < INTERACCIONES; i++)
  76.     {
  77.         new azar = Iter_Random(y_iterator);
  78.         #pragma unused azar
  79.     }
  80.     printf("azar    >> y_iterator >> "#INTERACCIONES" interacciones >> %d milisegundos", GetTickCount()-tiempo);
  81.  
  82.     // Buscar valores
  83.     printf("\n\n");
  84.  
  85.         // a_bucles
  86.     tiempo = GetTickCount();
  87.     for(new i = 0; i < INTERACCIONES; i++)
  88.     {
  89.         if(!forBu(a_bucles, i)) {}//printf("a_bucles :: HA OCURRIDO UN ERROR, NO SE ENCUENTRA EL VALOR...");
  90.     }
  91.  
  92.     printf("buscar  >> a_bucles   >> "#INTERACCIONES" interacciones >> %d milisegundos", GetTickCount()-tiempo);
  93.  
  94.         // y_iterator
  95.     tiempo = GetTickCount();
  96.     for(new i = 0; i < INTERACCIONES; i++)
  97.     {
  98.         if(!Iter_Contains(y_iterator, i)) {}// printf("y_iterator :: HA OCURRIDO UN ERROR, NO SE ENCUENTRA EL VALOR...");
  99.     }
  100.     printf("buscar  >> y_iterator >> "#INTERACCIONES" interacciones >> %d milisegundos", GetTickCount()-tiempo);
  101.  
  102.     // Eliminar valores
  103.     printf("\n\n");
  104.  
  105.         // a_bucles
  106.     tiempo = GetTickCount();
  107.     for(new i = 5; i < INTERACCIONES-1; i+=1)
  108.     {
  109.         forEl(a_bucles, i);
  110.     }
  111.  
  112.     printf("remover >> a_bucles   >> "#INTERACCIONES" interacciones >> %d milisegundos", GetTickCount()-tiempo);
  113.  
  114.         // y_iterator
  115.     tiempo = GetTickCount();
  116.     for(new i = 5; i < INTERACCIONES-1; i+=1)
  117.     {
  118.         Iter_Remove(y_iterator, i);
  119.     }
  120.     printf("remover >> y_iterator >> "#INTERACCIONES" interacciones >> %d milisegundos", GetTickCount()-tiempo);
  121.  
  122.     // Recorrido
  123.     printf("\n\n");
  124.  
  125.         // a_bucles
  126.     tiempo = GetTickCount();
  127.     forEach(i, a_bucles)
  128.     {
  129.         #pragma unused i
  130.     }
  131.  
  132.     printf("recorrer >> a_bucles   >> "#INTERACCIONES" interacciones >> %d milisegundos", GetTickCount()-tiempo);
  133.  
  134.         // y_iterator
  135.     tiempo = GetTickCount();
  136.     foreach(new w : y_iterator)
  137.     {
  138.         #pragma unused w
  139.     }
  140.  
  141.     printf("recorrer >> y_iterator >> "#INTERACCIONES" interacciones >> %d milisegundos", GetTickCount()-tiempo);
  142.  
  143.     //
  144.     printf("\n\n");
  145. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement