Is there a way to count the number of IL instructions executed?

后端 未结 5 623
萌比男神i
萌比男神i 2021-01-06 06:19

I want to do some benchmarking of a C# process, but I don\'t want to use time as my vector - I want to count the number of IL instructions that get executed in a particular

5条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-06 07:04

    I use the Code Metrics add in to Reflector

    The CodeMetrics add-in analyses and computes several code quality metrics on your assemblies. This add-in uses Reflector to compute classic metrics such as cyclomatic complexity or more straightforward ones such as the number of local variables in a method. All results can be saved to a file.

    Install the plugin. Select an assembly and load method metrics. It will show you a grid with CodeSize, CyclomaticComplexity, # of Instruction, etc.

提交回复
热议问题