【发布时间】:2017-04-27 20:12:38
【问题描述】:
我正在使用 C# 的“PerformanceCounter”类来计算“内存”类别下的以下 2 个计数器“可用字节”和“% Committed Bytes In Use”。
PerformanceCounter pc = new PerformanceCounter("Memory", "Available Bytes", true);
PerformanceCounter pc1 = new PerformanceCounter("Memory", "% Committed Bytes In Use", true);
var a = pc.RawValue;
var b = pc1.NextValue();
我在这里看到的问题是“RawValue”用于“Available Bytes”计数器,而“NextValue()”用于“% Committed Bytes In Use”计数器。
有没有统一的方法来计算两个或所有的计数器?
【问题讨论】:
标签: c# performancecounter