前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >20220517_统计脚本运行过程中使用的时间和运行内存

20220517_统计脚本运行过程中使用的时间和运行内存

原创
作者头像
wilson_bit
修改2022-05-17 10:37:24
6090
修改2022-05-17 10:37:24
举报
文章被收录于专栏:igenomeigenome

20220517_统计脚本运行过程中使用的时间和运行内存

必须使用/usr/bin/time调用time命令,不能直接使用time命令

代码语言:javascript
复制
(base) root@dell-server:/home/newdisk_dell_5/wilson/chlo_hmmsearch/test#   /usr/bin/time -v python chlo_hmmsearch-3.py
# CPU time: 2.13u 0.02s 00:00:02.15 Elapsed: 00:00:02.15
        Command being timed: "python chlo_hmmsearch-3.py"
        User time (seconds): 166.29
        System time (seconds): 77.66
        Percent of CPU this job got: 801%
        Elapsed (wall clock) time (h:mm:ss or m:ss): 0:30.45
        Average shared text size (kbytes): 0
        Average unshared data size (kbytes): 0
        Average stack size (kbytes): 0
        Average total size (kbytes): 0
        Maximum resident set size (kbytes): 546040
        Average resident set size (kbytes): 0
        Major (requiring I/O) page faults: 0
        Minor (reclaiming a frame) page faults: 18963522
        Voluntary context switches: 1917780
        Involuntary context switches: 138031
        Swaps: 0
        File system inputs: 56
        File system outputs: 901984
        Socket messages sent: 0
        Socket messages received: 0
        Signals delivered: 0
        Page size (bytes): 4096
        Exit status: 0

(一)时间相关

(二)内存相关

(三)IO 相关

(四)统计信息输出到文件

如果你希望将 time 统计的信息输出到文件,可以使用 -o 选项

代码语言:javascript
复制
root@chopin:~$ /usr/bin/time -v -o a.txt sleep 2

统计信息直接保存到了 a.txt,如果你希望统计信息能够追加到文件,可以额外加 -a 选项

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 20220517_统计脚本运行过程中使用的时间和运行内存
    • 必须使用/usr/bin/time调用time命令,不能直接使用time命令
    领券
    问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档