Click or drag to resize

PerfCounter Class

Simple performance counter to measure CPU cost of the code branch.
Inheritance Hierarchy
SystemObject
  KSPDev.DebugUtilsPerfCounter

Namespace:  KSPDev.DebugUtils
Assembly:  KSPDev_Utils.1.1 (in KSPDev_Utils.1.1.dll) Version: 1.1 for KSP v1.6+
Syntax
C#
public sealed class PerfCounter
Request Example View Source

The PerfCounter type exposes the following members.

Constructors
  NameDescription
Public methodPerfCounter
Initializes a new instance of the PerfCounter class
Top
Properties
  NameDescription
Public propertyavgDurationPerCallMs
Average time spent per one reading.
Public propertymaxDurationPerCallMs
Maximum time spent in one reading during the life of the counter.
Public propertyminDurationPerCallMs
Minimum time spent in one reading during the life of the counter.
Public propertynumSamples
Total number of readings captured.
Public propertytotalDurationMs
Total elapsed milleseconds in all readings.
Top
Methods
Remarks
The counter itself can have a performance impact, but it's not counted towards the methods or function cost being measured. Don't profile branches that have other performance counters, since such measurements will also count the overhead of thouse counters.
See Also