Skip to content

Instantly share code, notes, and snippets.

@techthoughts2

techthoughts2/cpu_stress

Last active Apr 22, 2021
Embed
What would you like to do?
$NumberOfLogicalProcessors = Get-CimInstance win32_processor | Select-Object -ExpandProperty NumberOfLogicalProcessors
ForEach ($core in 1..$NumberOfLogicalProcessors) {
start-job -ScriptBlock {
$result = 1;
foreach ($loopnumber in 1..2147483647) {
$result = 1;
foreach ($loopnumber1 in 1..2147483647) {
$result = 1;
foreach ($number in 1..2147483647) {
$result = $result * $number
}
}
$result
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment