コード例 #1
0
        protected Clase03Array decodificarClase03(String s)
        {
            Clase03Array cOut = null;

            watch.Restart();
            Decodificador03A dec = new Decodificador03A();

            for (int i = 0; i < this.veces; i++)
            {
                Object cAuxA = null;
                cAuxA = dec.decode(s);
                cOut  = (Clase03Array)cAuxA;
            }
            watch.Stop();
            Console.WriteLine("Decodificación con arrays A: " + watch.ElapsedMilliseconds + " milisegundos");

            watch.Restart();
            Decodificador03B decB = new Decodificador03B();

            for (int i = 0; i < this.veces; i++)
            {
                decB.decode(ref cOut, s);
            }
            watch.Stop();
            Console.WriteLine("Decodificación con arrays B: " + watch.ElapsedMilliseconds + " milisegundos");

            watch.Restart();
            Type t = typeof(Fase02.Clase03Array);

            for (int i = 0; i < this.veces; i++)
            {
                Object aux = s.decodificar(t);
            }
            watch.Stop();
            Console.WriteLine("Decodificación con arrays C: " + watch.ElapsedMilliseconds + " milisegundos");

            watch.Restart();
            for (int i = 0; i < this.veces; i++)
            {
                SerializerStatic.decode(ref cOut, s);
            }
            watch.Stop();
            Console.WriteLine("Decodificación con arrays D: " + watch.ElapsedMilliseconds + " milisegundos");

            return(cOut);
        }
コード例 #2
0
        protected Clase03Array decodificarClase03(String s)
        {
            Clase03Array cOut = null;

            watch.Restart();
            Decodificador03A dec = new Decodificador03A();
            for (int i = 0; i < this.veces; i++)
            {
                Object cAuxA = null;
                cAuxA = dec.decode(s);
                cOut = (Clase03Array)cAuxA;
            }
            watch.Stop();
            Console.WriteLine("Decodificación con arrays A: " + watch.ElapsedMilliseconds + " milisegundos");

            watch.Restart();
            Decodificador03B decB = new Decodificador03B();
            for (int i = 0; i < this.veces; i++)
            {
                decB.decode(ref cOut, s);
            }
            watch.Stop();
            Console.WriteLine("Decodificación con arrays B: " + watch.ElapsedMilliseconds + " milisegundos");

            watch.Restart();
            Type t = typeof(Fase02.Clase03Array);
            for (int i = 0; i < this.veces; i++)
            {
                Object aux = s.decodificar(t);
            }
            watch.Stop();
            Console.WriteLine("Decodificación con arrays C: " + watch.ElapsedMilliseconds + " milisegundos");

            watch.Restart();
            for (int i = 0; i < this.veces; i++)
            {
                SerializerStatic.decode(ref cOut, s);
            }
            watch.Stop();
            Console.WriteLine("Decodificación con arrays D: " + watch.ElapsedMilliseconds + " milisegundos");

            return cOut;
        }