{"id":5984,"date":"2025-02-26T14:34:33","date_gmt":"2025-02-26T06:34:33","guid":{"rendered":"https:\/\/blog.qdac.cc\/?p=5984"},"modified":"2025-02-26T14:35:58","modified_gmt":"2025-02-26T06:35:58","slug":"%e6%95%99%e7%a8%8bqprofile%e6%95%99%e7%a8%8b%e4%b9%8b%e5%85%ad%e8%b7%9f%e8%b8%aa%e5%87%bd%e6%95%b0%e8%be%83%e5%b7%ae%e6%97%b6%e7%9a%84%e5%8f%82%e6%95%b0%e5%88%b0%e6%97%a5%e5%bf%97%e4%b8%ad","status":"publish","type":"post","link":"https:\/\/blog.qdac.cc\/?p=5984","title":{"rendered":"[\u6559\u7a0b]QProfile\u6559\u7a0b\u4e4b\u516d:\u8ddf\u8e2a\u51fd\u6570\u8f83\u5dee\u65f6\u7684\u53c2\u6570\u5230\u65e5\u5fd7\u4e2d"},"content":{"rendered":"\n<p>\u901a\u8fc7\u524d\u9762\u7684\u6559\u7a0b\uff0c\u6211\u4eec\u5df2\u7ecf\u4e86\u89e3\u4e86\u5e38\u89c4\u7684 QProfile \u6027\u80fd\u5206\u6790\u65e5\u5fd7\u7684\u65b9\u6cd5\u3002\u4f46\u662f\uff0c\u901a\u8fc7\u8fd9\u4e2a\u6027\u80fd\u5206\u6790\u8ddf\u8e2a\u8bb0\u5f55\uff0c\u6211\u4eec\u53ea\u80fd\u5f97\u5230\u8fd9\u4e9b\u51fd\u6570\u90a3\u4e2a\u6267\u884c\u65f6\u95f4\u957f\uff0c\u4f46\u4e3a\u4ec0\u4e48\u6267\u884c\u65f6\u95f4\u957f\u5374\u6beb\u65e0\u5934\u7eea\uff0c\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e00\u95ee\u9898\uff0cTQProfile.Calc \u65b9\u6cd5\uff0c\u6211\u4eec\u589e\u52a0\u4e86\u4e00\u4e2a\u56de\u8c03\u51fd\u6570\u53c2\u6570\uff0c\u7528\u6765\u8ba9\u7528\u6237\u6765\u5bf9\u6027\u80fd\u8ddf\u8e2a\u60c5\u51b5\u8fdb\u884c\u8fdb\u4e00\u6b65\u7684\u8be6\u7ec6\u5206\u6790\u3002<\/p>\n\n\n\n<p>\u4e0b\u9762\u662f\u4e00\u4e2a\u4f8b\u5b50\uff0c\u5f53\u6211\u4eec\u8fd9\u4e2a\u51fd\u6570\u6267\u884c\u8d85\u8fc7 100ms \u65f6\uff0c\u6211\u4eec\u6765\u5c06\u53c2\u6570\u8bb0\u5f55\u5230\u65e5\u5fd7\u4e2d\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>procedure TForm1.LoadFromFile(const AFileName:String);\nvar\n   AStream:TFileStream;\nbegin\nTQProfile.Calc(\n  procedure (const AEscapedTime:Double)\n  begin\n    if AEscapedTime>100 then\n       PostLog(llDebug,'\u52a0\u8f7d\u6587\u4ef6 %s \u7528\u65f6\u8fc7\u957f:%f ms',&#91;AFileName,AEscapedTime]);\n  end);\nAStream:=TFileStream.Create(AFileName,fmOpenRead or fmShareDenyWrite);\n....\nend;<\/code><\/pre>\n\n\n\n<p>\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u53c2\u6570\u8fdb\u4e00\u6b65\u590d\u73b0\u95ee\u9898\u7684\u53d1\u751f\u8fc7\u7a0b\uff0c\u4ece\u800c\u627e\u5230\u7a0b\u5e8f\u5361\u987f\u7684\u95ee\u9898\u6240\u5728\u3002<\/p>\n\n\n\n<p>\u5f53\u7136\uff0cTQProfile.Calc \u7684\u51e0\u4e2a\u91cd\u8f7d\u90fd\u5305\u542b\u4e86\u8fd9\u4e2a\u53ef\u9009\u53c2\u6570\u7684\uff0c\u5982\u679c\u60a8\u5f53\u524d\u7684\u7248\u672c\u6ca1\u6709\uff0c\u8bf7\u66f4\u65b0\u5230\u6700\u65b0\u7248\u672c\uff0c\u4ee5\u83b7\u5f97\u76f8\u5173\u7684\u652f\u6301\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u901a\u8fc7\u524d\u9762\u7684\u6559\u7a0b\uff0c\u6211\u4eec\u5df2\u7ecf\u4e86\u89e3\u4e86\u5e38\u89c4\u7684 Q [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[8,9,834,603],"tags":[],"class_list":["post-5984","post","type-post","status-publish","format-standard","hentry","category-delphi","category-qdac","category-qprofile","category-603"],"views":1043,"_links":{"self":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/5984","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5984"}],"version-history":[{"count":2,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/5984\/revisions"}],"predecessor-version":[{"id":5987,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/5984\/revisions\/5987"}],"wp:attachment":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5984"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5984"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5984"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}