Beispiel #1
0
        public static Envelope ExecuteDeserialization(IEnvelopeSerializer serializer, string json, int count)
        {
            var sw = System.Diagnostics.Stopwatch.StartNew();

            Envelope envelope = null;

            for (int i = 0; i < count; i++)
            {
                envelope = serializer.Deserialize(json);
            }
            sw.Stop();

            System.Console.WriteLine("{0}: {1} ms", serializer.GetType().Name, sw.ElapsedMilliseconds);

            return(envelope);
        }
Beispiel #2
0
        public static Envelope ExecuteDeserialization(IEnvelopeSerializer serializer, string json, int count)
        {
            var sw = System.Diagnostics.Stopwatch.StartNew();

            Envelope envelope = null;

            for (int i = 0; i < count; i++)
            {
                envelope = serializer.Deserialize(json);
            }
            sw.Stop();

            System.Console.WriteLine("{0}: {1} ms", serializer.GetType().Name, sw.ElapsedMilliseconds);

            return envelope;

        }
Beispiel #3
0
        public static string ExecuteSerialization(IEnvelopeSerializer serializer, Envelope envelope, int count)
        {
            string json = null;

            var sw = System.Diagnostics.Stopwatch.StartNew();
            for (int i = 0; i < count; i++)
            {
                json = serializer.Serialize(envelope);
            }
            sw.Stop();

            System.Console.WriteLine("{0}: {1} ms", serializer.GetType().Name, sw.ElapsedMilliseconds);

            return json;
        }