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); }
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; }
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; }