Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Espanso speed test between shell: and script
- # No discernible difference here on Linux, but recommend using script: to avoid calling
- # an unnecessary process
- # Conversation at https://discord.com/channels/884163483409731584/1013916990760554608/1253033704599846973
- global_vars:
- - name: code
- type: echo
- params:
- echo: |
- $startTime = Get-Date
- $processes = Get-Process
- for ($i = 1; $i -le 1000; $i++) {
- $sortedProcesses = $processes | Sort-Object -Property CPU -Descending
- }
- $endTime = Get-Date
- $totalTime = New-TimeSpan -Start $startTime -End $endTime
- Write-Output "Total execution time: $($totalTime.Hours) hours, $($totalTime.Minutes) minutes, $($totalTime.Seconds) seconds."
- matches:
- - trigger: :test1
- replace: "{{output}}"
- vars:
- - name: output
- type: shell
- params:
- shell: pwsh
- cmd: "{{code}}"
- - trigger: :test2
- replace: "{{output}}"
- vars:
- - name: output
- type: script
- params:
- args:
- - pwsh
- - -c
- - "{{code}} "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement