ITPub博客

首页 > Linux操作系统 > Linux操作系统 > [20201112]time TIMEFORMAT格式.txt

[20201112]time TIMEFORMAT格式.txt

原创 Linux操作系统 作者:lfree 时间:2020-11-13 08:44:08 0 删除 编辑

[20201112]time TIMEFORMAT格式.txt

--//time命令缺省显示如下:

# time echo  2^1000000 | bc > /dev/null
real    0m4.614s
user    0m4.598s
sys     0m0.006s

--//实际上可以显示格式使用TIMEFORMAT环境变量:

# TIMEFORMAT="%3lU user + %3lS system / %3lR elapsed = %P%% CPU Utilisation"
# time echo  2^1000000 | bc > /dev/null
0m4.632s user + 0m0.003s system / 0m4.644s elapsed = 99.80% CPU Utilisation

--//另外注意一点time还有一个外部命令。
# which  time
/usr/bin/time

--//使用-p可以回到格式。
 When the -p option is given the (portable) output format
          real %e
          user %U
          sys %S
       is used.

# time -p echo  2^1000000 | bc > /dev/null
real 4.12
user 4.11
sys 0.00

--//与前面还是有点不同。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/267265/viewspace-2733898/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
熟悉oracle相关技术,擅长sql优化,rman备份与恢复,熟悉linux shell编程。

注册时间:2008-01-03

  • 博文量
    4006
  • 访问量
    7969289