Created
October 11, 2013 21:15
-
-
Save rpgmaker/6942142 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Test("Regular Loop", () => | |
{ | |
var itemx = GetList(list, list2); | |
}); | |
Test("Regular Loop2", () => | |
{ | |
var itemx = GetList2(list, list2); | |
}); | |
Test("Linq", () => | |
{ | |
var itemx = ( | |
from x in list | |
join y in list2 on x.ID equals y.ID | |
select new DataHolder { x = x, y = y } | |
).ToList(); | |
//var ik = ""; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void Test(string name, Action action) | |
{ | |
var sw = new Stopwatch(); | |
sw.Start(); | |
for (var i = 0; i < MAX_COUNT; i++) | |
{ | |
action(); | |
} | |
sw.Stop(); | |
Console.WriteLine("Completed {0} in {1} Millisecond(s)", name, sw.ElapsedMilliseconds); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://gist.github.com/anonymous/6942121