Last active
June 21, 2018 10:18
-
-
Save Extred/9a7c827d3538b2bbc1bd2be50e4ecbee 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
using System; | |
using System.Diagnostics; | |
using System.Threading; | |
namespace wx_test | |
{ | |
class Program | |
{ | |
static string lettersGOOD = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
static string lettersBAD = ".-%&?ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
private static void Go(string sample, int iterations) | |
{ | |
for (int i = 0; i < iterations; i++) | |
{ | |
sample.StartsWith("SI"); | |
} | |
} | |
static void Main(string[] args) | |
{ | |
var cult = Thread.CurrentThread.CurrentCulture; | |
Console.WriteLine($"{cult}; {cult.CompareInfo}"); | |
Go(lettersGOOD, 1); | |
Go(lettersBAD, 1); | |
var stopwatch = Stopwatch.StartNew(); | |
Go(lettersGOOD, 1000000); | |
stopwatch.Stop(); | |
Console.WriteLine($"GOOD: {stopwatch.Elapsed}"); | |
stopwatch = Stopwatch.StartNew(); | |
Go(lettersBAD, 1000000); | |
stopwatch.Stop(); | |
Console.WriteLine($"BAD: {stopwatch.Elapsed}"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment