How accurate is System.Diagnostics.Stopwatch?

后端 未结 8 2232
花落未央
花落未央 2020-11-30 10:55

How accurate is System.Diagnostics.Stopwatch? I am trying to do some metrics for different code paths and I need it to be exact. Should I be using stopwatc

8条回答
  •  孤街浪徒
    2020-11-30 11:21

    MSDN has some examples of the stopwatch. They also have it showing how accurate it is within Nanoseconds. Hope this helps!

提交回复
热议问题