Created
January 26, 2018 00:59
-
-
Save ngetchell/d98d0c3f5140ddff040328900f900b75 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-Job | Remove-Job -Force | |
$Job = Measure-Command { 1..10 | ForEach-Object { | |
Start-Job -ArgumentList $_ -ScriptBlock { | |
Param($Arg) | |
$arg % 2 | |
} | |
} | |
Get-Job | Receive-Job -Wait | |
} | |
$Thread = Measure-Command { 1..10 | ForEach-Object { | |
Start-ThreadJob -ArgumentList $_ -ScriptBlock { | |
Param($Arg) | |
$arg % 2 | |
} | |
} | |
Get-Job | Receive-Job -Wait | |
} | |
"Job Milliseconds: {0}" -f $Job.TotalMilliseconds | |
"Thread Milliseconds: {0}" -f $Thread.TotalMilliseconds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment