Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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}");
- }
- }
- }
Add Comment
Please, Sign In to add comment