Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <YSI\y_iterate>
- #include <aINC\a_bucles>
- #define INTERACCIONES 5000
- new Bucle:a_bucles<INTERACCIONES>;
- new Iterator:y_iterator<INTERACCIONES>;
- public OnFilterScriptInit()
- {
- //Variable contenedora del tiempo
- new tiempo;
- // Agregar valores
- printf("\n\n");
- // a_bucles
- tiempo = GetTickCount();
- for(new i = 0; i < INTERACCIONES; i+=1)
- {
- forAg(a_bucles, i);
- }
- printf("agregar >> a_bucles >> "#INTERACCIONES" interacciones >> %d milisegundos", GetTickCount()-tiempo);
- // y_iterator
- tiempo = GetTickCount();
- for(new i = 0; i < INTERACCIONES; i+=1)
- {
- Iter_Add(y_iterator, i);
- }
- printf("agregar >> y_iterator >> "#INTERACCIONES" interacciones >> %d milisegundos", GetTickCount()-tiempo);
- // Recorrido
- printf("\n\n");
- // a_bucles
- tiempo = GetTickCount();
- forEach(i, a_bucles)
- {
- for(new a = 0; a < 1000; a++){}
- // printf("recorrido %i", i);
- #pragma unused i
- }
- printf("recorrer >> a_bucles >> "#INTERACCIONES" interacciones >> %d milisegundos", GetTickCount()-tiempo);
- // y_iterator
- tiempo = GetTickCount();
- foreach(new w : y_iterator)
- {
- for(new a = 0; a < 1000; a++){}
- // printf("recorrido %i", w);
- #pragma unused w
- }
- printf("recorrer >> y_iterator >> "#INTERACCIONES" interacciones >> %d milisegundos", GetTickCount()-tiempo);
- // Valores al azar
- printf("\n\n");
- // a_bucles
- tiempo = GetTickCount();
- for(new i = 0; i < INTERACCIONES; i++)
- {
- new azar = forAz(a_bucles);
- #pragma unused azar
- }
- printf("azar >> a_bucles >> "#INTERACCIONES" interacciones >> %d milisegundos", GetTickCount()-tiempo);
- // y_iterator
- tiempo = GetTickCount();
- for(new i = 0; i < INTERACCIONES; i++)
- {
- new azar = Iter_Random(y_iterator);
- #pragma unused azar
- }
- printf("azar >> y_iterator >> "#INTERACCIONES" interacciones >> %d milisegundos", GetTickCount()-tiempo);
- // Buscar valores
- printf("\n\n");
- // a_bucles
- tiempo = GetTickCount();
- for(new i = 0; i < INTERACCIONES; i++)
- {
- if(!forBu(a_bucles, i)) {}//printf("a_bucles :: HA OCURRIDO UN ERROR, NO SE ENCUENTRA EL VALOR...");
- }
- printf("buscar >> a_bucles >> "#INTERACCIONES" interacciones >> %d milisegundos", GetTickCount()-tiempo);
- // y_iterator
- tiempo = GetTickCount();
- for(new i = 0; i < INTERACCIONES; i++)
- {
- if(!Iter_Contains(y_iterator, i)) {}// printf("y_iterator :: HA OCURRIDO UN ERROR, NO SE ENCUENTRA EL VALOR...");
- }
- printf("buscar >> y_iterator >> "#INTERACCIONES" interacciones >> %d milisegundos", GetTickCount()-tiempo);
- // Eliminar valores
- printf("\n\n");
- // a_bucles
- tiempo = GetTickCount();
- for(new i = 5; i < INTERACCIONES-1; i+=1)
- {
- forEl(a_bucles, i);
- }
- printf("remover >> a_bucles >> "#INTERACCIONES" interacciones >> %d milisegundos", GetTickCount()-tiempo);
- // y_iterator
- tiempo = GetTickCount();
- for(new i = 5; i < INTERACCIONES-1; i+=1)
- {
- Iter_Remove(y_iterator, i);
- }
- printf("remover >> y_iterator >> "#INTERACCIONES" interacciones >> %d milisegundos", GetTickCount()-tiempo);
- // Recorrido
- printf("\n\n");
- // a_bucles
- tiempo = GetTickCount();
- forEach(i, a_bucles)
- {
- #pragma unused i
- }
- printf("recorrer >> a_bucles >> "#INTERACCIONES" interacciones >> %d milisegundos", GetTickCount()-tiempo);
- // y_iterator
- tiempo = GetTickCount();
- foreach(new w : y_iterator)
- {
- #pragma unused w
- }
- printf("recorrer >> y_iterator >> "#INTERACCIONES" interacciones >> %d milisegundos", GetTickCount()-tiempo);
- //
- printf("\n\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement