22 February 2023

Powershell - ignoring output performance

 

(Measure-Command -Expression { [void]$(1..100000) }).Milliseconds

53

(Measure-Command -Expression { $null = $(1..100000) }).Milliseconds

49

(Measure-Command -Expression { $(1..100000) > $null }).Milliseconds

62

(Measure-Command -Expression { $(1..100000) | Out-Null }).Milliseconds

393

No comments:

Post a Comment