Coming from my "answer" to question "Stopwatch in a Task seems to be additive across all tasks, want to measure just task interval"
What are the possible differences between creating a new Stopwatch instance as:
Stopwatch timer = System.Diagnostics.Stopwatch.StartNew();
with
Stopwatch timer = new Stopwatch();
timer.Start();
Implied subquestion:
Why was StartNew()
method provided?
It initializes a new System.Diagnostics.Stopwatch instance and sets the elapsed time property to zero, and starts measuring elapsed time
and save the one line code to implicitly calling Start() method
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With