using System; using System.Diagnostics; class Program { static void Main(string[] args) { // Create a stopwatch to measure the execution time Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); // TODO: write and call the function you want to measure // ... // Get the elapsed time in milliseconds stopwatch.Stop(); long elapsedTime = stopwatch.ElapsedMilliseconds; Console.WriteLine("The function took {0} milliseconds to execute.", elapsedTime); } }