Skip to content

Instantly share code, notes, and snippets.

@trollsic
Created April 6, 2016 21:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trollsic/6d112c12cc47a948e234b9421f4ae899 to your computer and use it in GitHub Desktop.
Save trollsic/6d112c12cc47a948e234b9421f4ae899 to your computer and use it in GitHub Desktop.
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