Using the StopWatch Class to Calculate the Execution Time →
Example:
Stopwatch sw = Stopwatch.StartNew();
for (int i = 0; i < 1000000; i++)
{
string str = "string";
}
sw.Stop();
Console.WriteLine("Time Spent : " +sw.Elapsed.TotalMilliseconds.ToString());
Notes
-
howardtharp liked this
-
dowding posted this