Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2
Stopwatch measures time elapsed. It is useful for micro-benchmarks in code optimization. It can perform routine and continuous performance monitoring. The Stopwatch type, found in System.Diagnostics, is useful in many contexts. Stopwatch provides easy-to-use and accurate measurement of time elapsed. It helps with benchmarking. In your example the start method is used to start measuring time till the stop method is called, the elapsed method returns the time elapsed beetween start and stop methods in milliseconds. More in depth info, https://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch(v=vs.110).aspx.
8th Jun 2018, 5:56 PM
Rusty.Metal