{"id":6215,"date":"2014-06-24T17:37:55","date_gmt":"2014-06-24T09:37:55","guid":{"rendered":"http:\/\/jpuyy.com\/?p=6215"},"modified":"2015-03-20T14:14:02","modified_gmt":"2015-03-20T06:14:02","slug":"linux-time-command","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=6215","title":{"rendered":"time\u547d\u4ee4"},"content":{"rendered":"<p>time\u547d\u4ee4\u7528\u4e8e\u8ba1\u7b97\u4e00\u4e2a\u547d\u4ee4\u6267\u884c\u7684\u65f6\u95f4<\/p>\n<p>\u4f8b\u5982sleep 2\u8fd0\u884c\u65f6\u95f4\u662f2\u79d2\u949f<\/p>\n<pre class=\"p1\">\/usr\/bin\/time sleep 2\r\n0.00user 0.00system 0:02.00elapsed 0%CPU (0avgtext+0avgdata 2656maxresident)k\r\n0inputs+0outputs (0major+211minor)pagefaults 0swaps<\/pre>\n<p>time\u540e\u9762\u53ef\u4ee5\u52a0\u5f88\u591a\u53c2\u6570\uff0c\u5982-o output.txt\u5c06\u7ed3\u679c\u8f93\u51fa\u5230\u6587\u4ef6<\/p>\n<pre class=\"p1\">\/usr\/bin\/time -o output.txt sleep 2<\/pre>\n<p>-f &#8220;%P&#8221; command \u53ef\u4ee5\u6309\u9700\u6c42\u8f93\u51facpu\u4f7f\u7528\u7387<\/p>\n<pre class=\"p1\">\/usr\/bin\/time -f \"%P cpu percentage\" find .\/ -name abc<\/pre>\n<p class=\"p1\">\u00a0-f &#8220;%M&#8221; command \u53ef\u4ee5\u6309\u9700\u6c42\u8f93\u51fa\u5185\u5b58\u4f7f\u7528\u7387\uff0c<\/p>\n<pre class=\"p1\">\/usr\/bin\/time -f \"%M Max Resident Set Size (Kb)\" find .\/ -name abc<\/pre>\n<p class=\"p1\">-f &#8220;%e&#8221; command \u6309\u79d2\u8f93\u51fa\u547d\u4ee4\u6267\u884c\u7684\u65f6\u95f4<\/p>\n<pre style=\"color: #111111;\">\/usr\/bin\/time -f \"%e running time (sec)\" find .\/ -name abc<\/pre>\n<p class=\"p1\">\u53c2\u8003<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"aNZoIHX5df\"><p><a href=\"https:\/\/www.thegeekstuff.com\/2013\/10\/time-command-format\/\">12 UNIX \/ Linux Time Command Output Format Option Examples<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;12 UNIX \/ Linux Time Command Output Format Option Examples&#8221; &#8212; The Geek Stuff\" src=\"https:\/\/www.thegeekstuff.com\/2013\/10\/time-command-format\/embed\/#?secret=Gy8zbo3NWk#?secret=aNZoIHX5df\" data-secret=\"aNZoIHX5df\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>time\u547d\u4ee4\u7528\u4e8e\u8ba1\u7b97\u4e00\u4e2a\u547d\u4ee4\u6267\u884c\u7684\u65f6\u95f4 \u4f8b\u5982sleep 2\u8fd0\u884c\u65f6\u95f4\u662f2\u79d2\u949f \/usr\/bin\/time sleep 2 0.00user 0.00system 0:02.00elapsed 0%CPU (0avgtext+0avgdata 2656maxresident)k 0inputs+0outputs (0major+211minor)pagefaults 0swaps time\u540e\u9762\u53ef\u4ee5\u52a0\u5f88\u591a\u53c2\u6570\uff0c\u5982-o output.txt\u5c06\u7ed3\u679c\u8f93\u51fa\u5230\u6587\u4ef6 \/usr\/bin\/time -o output.txt sleep 2 -f &#8220;%P&#8221; command \u53ef\u4ee5\u6309\u9700\u6c42\u8f93\u51facpu\u4f7f\u7528\u7387 \/usr\/bin\/time -f &#8220;%P cpu percentage&#8221; find .\/ -name abc \u00a0-f &#8220;%M&#8221; command \u53ef\u4ee5\u6309\u9700\u6c42\u8f93\u51fa\u5185\u5b58\u4f7f\u7528\u7387\uff0c \/usr\/bin\/time -f &#8220;%M Max Resident Set Size (Kb)&#8221; find .\/ -name abc -f &#8220;%e&#8221; command \u6309\u79d2\u8f93\u51fa\u547d\u4ee4\u6267\u884c\u7684\u65f6\u95f4 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[23],"class_list":["post-6215","post","type-post","status-publish","format-standard","hentry","category-linux","tag-summary"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/6215","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6215"}],"version-history":[{"count":4,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/6215\/revisions"}],"predecessor-version":[{"id":6451,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/6215\/revisions\/6451"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}