C# - 获取 RawFraction 性能计数器以显示持久值
我创建了一个性能计数器,它显示增量值(RawFraction
类型)相对于基值 (RawBase
) 的分数。
不幸的是,当监视该值时,它仅显示其中一个计数器递增时的百分比。在所有其他时间进行采样时,它都显示 0。是否有某种方法可以告诉计数器保留最后一个值,直到下次需要重新计算分数为止?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果不查看任何代码,很难知道出了什么问题,但这里有一个正确使用它的示例(来自:http://msdn.microsoft.com/en-us/library/system.diagnostics.performancecountertype.aspx)
It's hard to know what went wrong for you without seeing any of your code but here's an example of it being used correctly (from: http://msdn.microsoft.com/en-us/library/system.diagnostics.performancecountertype.aspx)