Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
for (int i = 0; i < 1000000; i++)
{
var words = text.Split(new []{' ', ',', ';', ':', '.', '?', '!'});
}
TimeSpan ts = stopWatch.Elapsed;
string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",
ts.Hours, ts.Minutes, ts.Seconds,
ts.Milliseconds / 10);
Debug.WriteLine("RunTime " + elapsedTime);
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
for (int i = 0; i < 1000000; i++)
{
var words = Regex.Matches(text, "(\\w+)");
}
TimeSpan ts = stopWatch.Elapsed;
string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",
ts.Hours, ts.Minutes, ts.Seconds,
ts.Milliseconds / 10);
Debug.WriteLine("RunTime " + elapsedTime);
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
for (int i = 0; i < 1000000; i++)
{
var words = text.Split(' ');
}
TimeSpan ts = stopWatch.Elapsed;
string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",
ts.Hours, ts.Minutes, ts.Seconds,
ts.Milliseconds / 10);
Debug.WriteLine("RunTime " + elapsedTime);
let dodik