Print Timestamp at shell to check the performance of command

Timestamp:2024/03/07 13:18:22

#!/usr/bin/bash
function tstamp() {
echo -e "Timestamp:`date '+%Y/%m/%d %H:%M:%S'`\n"
}
tstamp
echo "invoke the command to check"
tstamp


Output is as follows:

Timestamp:2024/03/07 13:18:22

invoke the command to check

Timestamp:2024/03/07 13:19:10

※注意 echoで改行を有効にするには、echo -e "xxxx\n" とする。

コメント

人気の投稿