Skip to content

Instantly share code, notes, and snippets.

@stuartpreston
Created August 18, 2014 16:37
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save stuartpreston/44186c464b6195143684 to your computer and use it in GitHub Desktop.
Save stuartpreston/44186c464b6195143684 to your computer and use it in GitHub Desktop.
Powershell profile that shows the execution time of the last executed command in ms.
function prompt
{
$host.ui.rawui.WindowTitle = (get-location)
$lastCommand = Get-History -Count 1
if($lastCommand) { Write-Host ("last command took") ($lastCommand.EndExecutionTime - $lastCommand.StartExecutionTime).TotalMilliseconds ("ms") }
return "PS>"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment