Copy the above code into your profile, then run Enable-ProfileBenchmark
and start a new pwsh process.
You will get the top 10 slowest commands in your profile:
You can get a more detailed view by going to https://speedscope.app and uploading the json file as mentioned in the output.