How accurate is System.Diagnostics.Stopwatch?

后端 未结 8 2140
花落未央
花落未央 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:42

    Why you don't profile your code instead of focusing on micro-benchmarks?

    There are some good Open Source profilers like:

    • NProf
    • Prof-It for C#
    • NProfiler
    • ProfileSharp

提交回复
热议问题