Skip to content

Instantly share code, notes, and snippets.

@jbw
Last active March 28, 2016 21:08
Show Gist options
  • Save jbw/998ad17d8fbcdbf37905 to your computer and use it in GitHub Desktop.
Save jbw/998ad17d8fbcdbf37905 to your computer and use it in GitHub Desktop.
static List<long> RunSerializer(IJsonSerializer jsonSerializer, int iterations, TestObj testObj)
{
var timing = new List<long>();
var sw = new Stopwatch();
for (int i = 0; i < iterations; i++)
{
sw.Start();
var serialised = jsonSerializer.SerializeToString(testObj);
sw.Stop();
timing.Add(sw.ElapsedTicks);
sw.Reset();
}
return timing;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment