Created
November 10, 2019 17:33
-
-
Save IISResetMe/b87703ba062f6d742792fcd95d360014 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
# download and install https://github.com/IISResetMe/MeasureScript/tree/master/src | |
Import-Module MeasureScript | |
Measure-Script -ScriptBlock {# use a stopwatch to measure performance | |
$stopwatch = [System.Diagnostics.Stopwatch]::StartNew() | |
# create a StringBuilder | |
$text = "" | |
# appending a string often | |
# using foreach and avoiding the pipeline | |
foreach($_ in (1..10000)) | |
{ | |
# replace operator += with AddLine(): | |
$text += "working on $_`r`n" | |
}} |Tee-Object -Variable results | |
# Copy $results[11].TimeLine.TimeSpans to a file and feed to a line graph plotter (I just pasted it into Excel) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment