Created
April 6, 2016 21:35
-
-
Save trollsic/6d112c12cc47a948e234b9421f4ae899 to your computer and use it in GitHub Desktop.
This file contains 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
void Main() | |
{ | |
string firstEffectName = "Shot"; | |
string secondEffectName = "Boom"; | |
var sw = System.Diagnostics.Stopwatch.StartNew(); | |
for(int i = 0; i< 1000000; i++) | |
{ | |
var a = string.Compare(firstEffectName, secondEffectName, StringComparison.InvariantCultureIgnoreCase) == 0; | |
} | |
sw.Stop(); | |
Console.WriteLine("InvariantCultureIgnoreCase: {0}ms",sw.ElapsedMilliseconds); | |
sw.Restart(); | |
for(int i = 0; i< 1000000; i++) | |
{ | |
var a = string.Compare(firstEffectName, secondEffectName, StringComparison.OrdinalIgnoreCase) == 0; | |
} | |
sw.Stop(); | |
Console.WriteLine("OrdinalIgnoreCase: {0}ms",sw.ElapsedMilliseconds); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment