小编Car*_*ter的帖子

ASP.NET CORE LINUX 获取 CPU 使用情况

使用此代码,这适用于 Windows。对于 Linux(Ubuntu)“Linux 中未提供 PerformanceCounter”

PerformanceCounter counter = GetPerfCounterForProcessId(process.Id); //Just gets process by id dont worry...
var processUsages = counter.NextValue();
double processUsage = counter.NextValue() / Environment.ProcessorCount;
Run Code Online (Sandbox Code Playgroud)

在 Linux 中,如何通过 ID 调用此方法来获取进程的 CPU 使用率?

asp.net-core

6
推荐指数
1
解决办法
6310
查看次数

标签 统计

asp.net-core ×1