cpu /磁盘使用率高时延迟

时间:2019-07-19 05:14:48

标签: windows-10 powershell-5.0 perfmon

如何在大部分用户登录完成之前创建延迟?

这应该延迟大约3分钟,但是延迟34秒。

$zprotime = 80
$zdisk = 1600
$zprocess = 60000
while (($zprotime -gt 16) -or ($zdisk -gt 72) -or ($zprocess -gt 32000)) {
    $zprotime = Get-Counter '\Processor Information(_total)\% Processor Time' |
                ForEach-Object {$_.CounterSamples[0].CookedValue}
    $zdisk = Get-Counter '\PhysicalDisk(0 C: D: E: F: G:)\Disk Transfers/sec' |
                ForEach-Object {$_.CounterSamples[0].CookedValue}
    $zprocess = Get-Counter '\Process(_total)\IO Data Operations/sec' |
                ForEach-Object {$_.CounterSamples[0].CookedValue}
}
exit 

PerfMon report

0 个答案:

没有答案