powershellHow to measure command execution time
This code first sets the $start
variable to the current date and time using the Get-Date
cmdlet. Then, it runs some other code. After that, it waits for 15 seconds using the Start-Sleep
cmdlet (Only for Testing Purposes). Finally, it calculates the time difference between the current date and time and the start time, and assigns it to the $time
variable.
More of Powershell
- How to retrieve last element of array
- How to get current PS cmdlet general shell hosting info and version(s)
- How to retrieve your internet's public facing IP address in powershell
- How to retrieve numbers divisible by 10 from a list of values
- How to filter a list of strings by specific text included in string
- How to retrieve an array that is inside another array or list
- How to get detailed PS versioning information of your system
- How to validate default keyboard layout is EN-US
- How to get local system keyboard layout information
See more codes...