Advertisement
tfl

Measuring late vs early filtering

tfl
Jan 30th, 2015
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $eftotal = $lftotal = 0
  2. "{0,15} {1,15} {2,15}" -f "Early Filter", "LateFilter", 'Difference'
  3.  
  4. 1..1000 | foreach {
  5.  
  6. $ef = (Measure-Command {
  7. Get-Process Power*
  8. }).milliseconds
  9. $eftotal +=$ef
  10.  
  11. $lf = (Measure-Command {
  12. Get-Process | Where-Object name -like Power*
  13. }).Milliseconds
  14. $lftotal += $lf
  15.  
  16. $diff = $ef - $lf
  17. #"{0,15:n1} {1,15:n1} {2,15:n1}" -f $ef, $lf,$diff
  18. }
  19.  
  20. $tdiff = $eftotal - $lftotal
  21. "{0,15:n1} {1,15:n1} {2,15:n1}" -f $eftotal, $lftotal,$tdiff
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement