Prompt command times
Dates before and after execution
Show date before execution:
1 | PS0=">>> \$(date +%Y-%m-%d\ %T.%3N)\\n$PS0" |
Show date after execution:
1 | PROMPT_COMMAND='echo "<<< $(date +%Y-%m-%d\ %T.%3N)";'$PROMPT_COMMAND |
Execution time
1 | PS0='${t:0:$((t=$(date +%s%N),0))}' |
Both
1 | PS0="\e[33m>>> \$(date +%Y-%m-%d\ %T.%3N)\e[0m\\n\${t:0:\$((t=\$(date +%s%N),0))}" |
Recommendations
Recommendations