Question: How do you write a timer that calculates microseconds in C#? Below is my code that only does milliseconds and it isnt quick enough public
How do you write a timer that calculates microseconds in C#? Below is my code that only does milliseconds and it isnt quick enough
public void DisplayTime() { var watch = System.Diagnostics.Stopwatch.StartNew(); // the code that you want to measure comes here watch.Stop(); var elapsedMs = watch.ElapsedMilliseconds;
Console.WriteLine("Time processed: {0}ms", watch.ElapsedMilliseconds); }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
