static void Main(string[] args) { Stopwatch stopwatch = new Stopwatch(); using(var timeBlock = new TimeMeasurementBlock(stopwatch)) { for(int i = 0; i < 300000; i++) { IsPrime(i); } Console.WriteLine(timeBlock.Stopwatch.ElapsedMilliseconds); } }
static void Main(string[] args) { Stopwatch stopwatch = new Stopwatch(); using (var timeBlock = new TimeMeasurementBlock(stopwatch)) { for (int i = 0; i < 300000; i++) { IsPrime(i); } Console.WriteLine(timeBlock.Stopwatch.ElapsedMilliseconds); } }