Benchpress

Different Ways To Iterate

(@ 2095 Mhz)

Technique RepeatCount Time RelativeSpeed Throughput
Foreach Statement 100 00:00:00.007720 1x 12952.53/s
For _ 100 00:00:00.008226 1.07x 12156.43/s
For loop 100 00:00:00.008528 1.1x 11725.25/s
Foreach _ 100 00:00:00.009958 1.29x 10041.47/s
Pipe to ScriptBlock 100 00:00:00.017071 2.21x 5857.61/s
Foreach-Object 100 00:00:00.089727 11.62x 1114.48/s