forked from gregsdennis/Manatee.Json
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathParseTest.cs
38 lines (37 loc) · 981 Bytes
/
ParseTest.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using System.IO;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Manatee.Json.Tests.Performance
{
[TestClass]
[DeploymentItem("Associates.json")]
public class ParseTest
{
[TestMethod]
public void Performance_Parse_Single()
{
Console.WriteLine("Time To Beat: 00:00:00.0110006");
var content = File.ReadAllText("Associates.json");
var start = DateTime.Now;
var json = JsonValue.Parse(content);
var end = DateTime.Now;
Console.WriteLine(json);
Console.WriteLine(end - start);
}
[TestMethod]
public void Performance_Parse_10000()
{
Console.WriteLine("Time To Beat: 00:00:00.3410196");
var content = File.ReadAllText("Associates.json");
var start = DateTime.Now;
JsonValue json = null;
for (int i = 0; i < 10000; i++)
{
json = JsonValue.Parse(content);
}
var end = DateTime.Now;
Console.WriteLine(json);
Console.WriteLine(end - start);
}
}
}