{"id":210631,"date":"2023-12-22T07:01:20","date_gmt":"2023-12-21T23:01:20","guid":{"rendered":"https:\/\/www.idc.net\/help\/210631\/"},"modified":"2023-12-22T07:01:20","modified_gmt":"2023-12-21T23:01:20","slug":"linux-%e5%91%bd%e4%bb%a4%ef%bc%9atime-%e8%ae%a1%e6%97%b6%e4%b8%80%e4%b8%aa%e7%ae%80%e5%8d%95%e5%91%bd%e4%bb%a4%e6%88%96%e7%bb%99%e5%87%ba%e8%b5%84%e6%ba%90%e4%bd%bf%e7%94%a8%e6%83%85%e5%86%b5","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/210631\/","title":{"rendered":"Linux \u547d\u4ee4\uff1atime &#8211; \u8ba1\u65f6\u4e00\u4e2a\u7b80\u5355\u547d\u4ee4\u6216\u7ed9\u51fa\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5"},"content":{"rendered":"<p><title id=\"linux-%e5%91%bd%e4%bb%a4%ef%bc%9atime-%e8%ae%a1%e6%97%b6%e4%b8%80%e4%b8%aa%e7%ae%80%e5%8d%95%e5%91%bd%e4%bb%a4%e6%88%96%e7%bb%99%e5%87%ba%e8%b5%84%e6%ba%90%e4%bd%bf%e7%94%a8%e6%83%85%e5%86%b5-flQkEyFFvq\">Linux \u547d\u4ee4\uff1atime - \u8ba1\u65f6\u4e00\u4e2a\u7b80\u5355\u547d\u4ee4\u6216\u7ed9\u51fa\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5<\/title><\/p>\n<h1 id=\"linux-%e5%91%bd%e4%bb%a4%ef%bc%9atime-%e8%ae%a1%e6%97%b6%e4%b8%80%e4%b8%aa%e7%ae%80%e5%8d%95%e5%91%bd%e4%bb%a4%e6%88%96%e7%bb%99%e5%87%ba%e8%b5%84%e6%ba%90%e4%bd%bf%e7%94%a8%e6%83%85%e5%86%b5-flQkEyFFvq\">Linux \u547d\u4ee4\uff1atime - \u8ba1\u65f6\u4e00\u4e2a\u7b80\u5355\u547d\u4ee4\u6216\u7ed9\u51fa\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5<\/h1>\n<p>\u5728Linux\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0c\u6709\u8bb8\u591a\u5f3a\u5927\u7684\u547d\u4ee4\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u7ba1\u7406\u548c\u76d1\u63a7\u7cfb\u7edf\u8d44\u6e90\u3002\u5176\u4e2d\u4e00\u4e2a\u975e\u5e38\u6709\u7528\u7684\u547d\u4ee4\u662f<code>time<\/code>\u547d\u4ee4\u3002\u8be5\u547d\u4ee4\u53ef\u4ee5\u7528\u4e8e\u8ba1\u65f6\u4e00\u4e2a\u7b80\u5355\u547d\u4ee4\u7684\u6267\u884c\u65f6\u95f4\uff0c\u6216\u8005\u7ed9\u51fa\u547d\u4ee4\u6267\u884c\u8fc7\u7a0b\u4e2d\u7684\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5\u3002<\/p>\n<h2 id=\"%e5%9f%ba%e6%9c%ac%e8%af%ad%e6%b3%95-flQkEyFFvq\">\u57fa\u672c\u8bed\u6cd5<\/h2>\n<p>\u4e0b\u9762\u662f<code>time<\/code>\u547d\u4ee4\u7684\u57fa\u672c\u8bed\u6cd5\uff1a<\/p>\n<pre><code>time [options] command<\/code><\/pre>\n<p>\u5176\u4e2d\uff0c<code>options<\/code>\u662f\u53ef\u9009\u7684\u53c2\u6570\uff0c\u53ef\u4ee5\u7528\u6765\u5b9a\u5236<code>time<\/code>\u547d\u4ee4\u7684\u884c\u4e3a\u3002\u800c<code>command<\/code>\u5219\u662f\u8981\u6267\u884c\u7684\u547d\u4ee4\u3002<\/p>\n<h2 id=\"%e8%ae%a1%e6%97%b6%e5%91%bd%e4%bb%a4%e6%89%a7%e8%a1%8c%e6%97%b6%e9%97%b4-flQkEyFFvq\">\u8ba1\u65f6\u547d\u4ee4\u6267\u884c\u65f6\u95f4<\/h2>\n<p>\u8981\u8ba1\u65f6\u4e00\u4e2a\u7b80\u5355\u547d\u4ee4\u7684\u6267\u884c\u65f6\u95f4\uff0c\u53ea\u9700\u5728\u547d\u4ee4\u524d\u52a0\u4e0a<code>time<\/code>\u547d\u4ee4\u5373\u53ef\u3002\u4f8b\u5982\uff0c\u8981\u8ba1\u65f6<code>ls<\/code>\u547d\u4ee4\u7684\u6267\u884c\u65f6\u95f4\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>time ls<\/code><\/pre>\n<p>\u6267\u884c\u4ee5\u4e0a\u547d\u4ee4\u540e\uff0c<code>time<\/code>\u547d\u4ee4\u4f1a\u8f93\u51fa\u547d\u4ee4\u7684\u6267\u884c\u65f6\u95f4\u4fe1\u606f\uff0c\u5305\u62ec\u5b9e\u9645\u65f6\u95f4\u3001\u7528\u6237\u65f6\u95f4\u548c\u7cfb\u7edf\u65f6\u95f4\u3002<\/p>\n<h2 id=\"%e7%bb%99%e5%87%ba%e8%b5%84%e6%ba%90%e4%bd%bf%e7%94%a8%e6%83%85%e5%86%b5-flQkEyFFvq\">\u7ed9\u51fa\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5<\/h2>\n<p>\u9664\u4e86\u8ba1\u65f6\u547d\u4ee4\u7684\u6267\u884c\u65f6\u95f4\uff0c<code>time<\/code>\u547d\u4ee4\u8fd8\u53ef\u4ee5\u7ed9\u51fa\u547d\u4ee4\u6267\u884c\u8fc7\u7a0b\u4e2d\u7684\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5\u3002\u8981\u542f\u7528\u8fd9\u4e2a\u529f\u80fd\uff0c\u53ef\u4ee5\u4f7f\u7528<code>-v<\/code>\u9009\u9879\u3002\u4f8b\u5982\uff1a<\/p>\n<pre><code>time -v ls<\/code><\/pre>\n<p>\u6267\u884c\u4ee5\u4e0a\u547d\u4ee4\u540e\uff0c<code>time<\/code>\u547d\u4ee4\u4f1a\u8f93\u51fa\u66f4\u8be6\u7ec6\u7684\u4fe1\u606f\uff0c\u5305\u62ecCPU\u4f7f\u7528\u60c5\u51b5\u3001\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\u3001\u78c1\u76d8I\/O\u7b49\u3002<\/p>\n<h2 id=\"%e7%a4%ba%e4%be%8b-flQkEyFFvq\">\u793a\u4f8b<\/h2>\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528<code>time<\/code>\u547d\u4ee4\u8ba1\u65f6\u547d\u4ee4\u6267\u884c\u65f6\u95f4\u7684\u793a\u4f8b\uff1a<\/p>\n<pre><code>time sleep 5<\/code><\/pre>\n<p>\u6267\u884c\u4ee5\u4e0a\u547d\u4ee4\u540e\uff0c<code>time<\/code>\u547d\u4ee4\u4f1a\u8f93\u51fa\u7c7b\u4f3c\u4ee5\u4e0b\u7684\u4fe1\u606f\uff1a<\/p>\n<pre><code>real    0m5.003s\nuser    0m0.000s\nsys     0m0.000s<\/code><\/pre>\n<p>\u5176\u4e2d\uff0c<code>real<\/code>\u8868\u793a\u5b9e\u9645\u65f6\u95f4\uff0c<code>user<\/code>\u8868\u793a\u7528\u6237\u65f6\u95f4\uff0c<code>sys<\/code>\u8868\u793a\u7cfb\u7edf\u65f6\u95f4\u3002<\/p>\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528<code>time<\/code>\u547d\u4ee4\u7ed9\u51fa\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5\u7684\u793a\u4f8b\uff1a<\/p>\n<pre><code>time -v ls<\/code><\/pre>\n<p>\u6267\u884c\u4ee5\u4e0a\u547d\u4ee4\u540e\uff0c<code>time<\/code>\u547d\u4ee4\u4f1a\u8f93\u51fa\u66f4\u8be6\u7ec6\u7684\u4fe1\u606f\uff0c\u5305\u62ecCPU\u4f7f\u7528\u60c5\u51b5\u3001\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\u3001\u78c1\u76d8I\/O\u7b49\u3002<\/p>\n<h2 id=\"%e6%80%bb%e7%bb%93-flQkEyFFvq\">\u603b\u7ed3<\/h2>\n<p><code>time<\/code>\u547d\u4ee4\u662fLinux\u7cfb\u7edf\u4e2d\u4e00\u4e2a\u975e\u5e38\u6709\u7528\u7684\u547d\u4ee4\uff0c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u8ba1\u65f6\u547d\u4ee4\u7684\u6267\u884c\u65f6\u95f4\uff0c\u6216\u8005\u7ed9\u51fa\u547d\u4ee4\u6267\u884c\u8fc7\u7a0b\u4e2d\u7684\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5\u3002\u901a\u8fc7\u4f7f\u7528<code>time<\/code>\u547d\u4ee4\uff0c\u6211\u4eec\u53ef\u4ee5\u66f4\u597d\u5730\u4e86\u89e3\u547d\u4ee4\u7684\u6027\u80fd\u548c\u8d44\u6e90\u6d88\u8017\u60c5\u51b5\uff0c\u4ece\u800c\u4f18\u5316\u7cfb\u7edf\u7684\u8fd0\u884c\u3002<\/p>\n<h3 id=\"%e9%a6%99%e6%b8%af%e6%9c%8d%e5%8a%a1%e5%99%a8%e9%a6%96%e9%80%89%e5%90%8e%e6%b5%aa%e4%ba%91-flQkEyFFvq\">\u9999\u6e2f\u670d\u52a1\u5668\u9996\u9009\u540e\u6d6a\u4e91<\/h3>\n<p>\u5982\u679c\u60a8\u6b63\u5728\u5bfb\u627e\u53ef\u9760\u7684\u9999\u6e2f\u670d\u52a1\u5668\u63d0\u4f9b\u5546\uff0c\u540e\u6d6a\u4e91\u662f\u60a8\u7684\u9996\u9009\u3002\u540e\u6d6a\u4e91\u63d0\u4f9b\u9ad8\u6027\u80fd\u7684\u9999\u6e2f\u670d\u52a1\u5668\uff0c\u4e3a\u60a8\u7684\u4e1a\u52a1\u63d0\u4f9b\u7a33\u5b9a\u53ef\u9760\u7684\u6258\u7ba1\u670d\u52a1\u3002\u4e86\u89e3\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u8bbf\u95ee<a href=\"https:\/\/idc.net\">\u540e\u6d6a\u4e91\u5b98\u7f51<\/a>\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux \u547d\u4ee4\uff1atime - \u8ba1\u65f6\u4e00\u4e2a\u7b80\u5355\u547d\u4ee4\u6216\u7ed9\u51fa\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5 Linux \u547d\u4ee4\uff1atime - \u8ba1\u65f6\u4e00\u4e2a\u7b80 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[],"class_list":["post-210631","post","type-post","status-publish","format-standard","hentry","category-centos"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/210631","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=210631"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/210631\/revisions"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=210631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=210631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=210631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}