{"id":5931,"date":"2025-01-09T21:13:06","date_gmt":"2025-01-09T13:13:06","guid":{"rendered":"https:\/\/blog.qdac.cc\/?p=5931"},"modified":"2025-01-09T21:13:07","modified_gmt":"2025-01-09T13:13:07","slug":"%e6%95%99%e7%a8%8bqprofile%e6%95%99%e7%a8%8b%e4%b9%8b%e4%b8%89%ef%bc%9a%e5%88%86%e6%9e%90%e4%b8%80%e4%b8%aa%e5%87%bd%e6%95%b0%e4%b8%ad%e5%a4%9a%e4%b8%aa%e4%bb%a3%e7%a0%81%e6%ae%b5%e7%9a%84%e6%80%a7","status":"publish","type":"post","link":"https:\/\/blog.qdac.cc\/?p=5931","title":{"rendered":"[\u6559\u7a0b]QProfile\u6559\u7a0b\u4e4b\u4e09\uff1a\u5206\u6790\u4e00\u4e2a\u51fd\u6570\u4e2d\u591a\u4e2a\u4ee3\u7801\u6bb5\u7684\u6027\u80fd\u5f71\u54cd"},"content":{"rendered":"\n<p>\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u90fd\u662f\u57fa\u4e8e\u51fd\u6570\u6765\u5206\u6790\u4ee3\u7801\u7684\u8c03\u7528\u5173\u7cfb\u548c\u6027\u80fd\uff0c\u4f46\u901a\u8fc7\u5bf9\u53d8\u91cf\u4f5c\u7528\u57df\u7684\u63a7\u5236\uff0c\u6211\u4eec\u5b9e\u9645\u4e0a\u662f\u53ef\u4ee5\u5f88\u5bb9\u6613\u5c31\u53ef\u4ee5\u5bf9\u4e00\u4e2a\u51fd\u6570\u7684\u7684\u4e0d\u540c\u6bb5\u8fdb\u884c\u6027\u80fd\u8ba1\u6570\u548c\u5206\u6790\u3002<\/p>\n\n\n\n<p>\u5bf9\u4e8e\u4e00\u4e2a\u51fd\u6570\uff0c\u5982\u679c\u6211\u4eec\u8981\u5206\u591a\u6bb5\u8fdb\u884c\u5206\u6790\uff0c\u53ef\u4ee5\u901a\u8fc7\u4e24\u79cd\u65b9\u6cd5\u6765\u5904\u7406\uff1a<\/p>\n\n\n\n<p><strong>1\u3001\u901a\u8fc7 begin\/end \u590d\u5408\u8bed\u53e5\uff0c\u81ea\u52a8\u63a7\u5236\u53d8\u91cf\u7684\u4f5c\u7528\u57df\u3002<\/strong>\u6211\u4eec\u5df2\u77e5\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>TQProfile.Calc \u662f\u6709\u4e00\u4e2a\u8fd4\u56de\u503c\u7684\uff0c\u6211\u4eec\u662f\u901a\u8fc7\u63a7\u5236\u7f16\u8bd1\u5668\u81ea\u52a8\u7ef4\u62a4\u7684\u8fd4\u56de\u503c\u751f\u547d\u5468\u671f\uff0c\u6765\u8bb0\u5f55\u51fd\u6570\u7684\u8c03\u7528\u987a\u5e8f\u3002\u6bcf\u4e00\u6b21 Calc \u90fd\u4f1a\u5165\u6808\u4e00\u4e2a\u65b0\u7684\u6808\u4fe1\u606f\uff0c\u5e76\u589e\u52a0\u5f15\u7528\u8ba1\u6570\uff0c\u800c\u6bcf\u6b21\u51cf\u5c11\u5f15\u7528\u8ba1\u6570\uff0c\u90fd\u4f1a\u5bf9\u5e94\u4e00\u4e2a\u6808\u8bb0\u5f55\u68c0\u67e5\uff0c\u5e76\u5728\u6b63\u786e\u7684\u65f6\u673a\u51fa\u6808\u3002<\/li>\n\n\n\n<li>\u590d\u5408\u8bed\u53e5\u6bb5\u4e2d\u7684\u4e34\u65f6\u53d8\u91cf\u7684\u751f\u547d\u5468\u671f\uff0c\u4ec5\u9650\u4e8e\u590d\u5408\u8bed\u53e5\u6bb5\u3002\u7f16\u8bd1\u5668\u4f1a\u5728\u5bf9\u5e94\u7684 end \u8bed\u53e5\u524d\uff0c\u63d2\u5165\u6e05\u7406\u7684\u4ee3\u7801\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u57fa\u4e8e\u4ee5\u4e0a\u539f\u56e0\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5199\u51fa\u7c7b\u4f3c\u5982\u4e0b\u7684\u4ee3\u7801\u903b\u8f91<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>begin\n  TQProfile.Calc('Phase1');\n  ...\n  if x>100 then\n  begin\n    TQProfile.Calc('Phase2');\n    ...\n  end\n  else\n  begin\n    TQProfile.Calc('Phase3');\n    ...\n  end;\nend;<\/code><\/pre>\n\n\n\n<p>\u901a\u8fc7\u4e0a\u9762\u7684\u65b9\u5f0f\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5f97\u51fa Phase1 \u7684\u603b\u6267\u884c\u65f6\u95f4\u4fe1\u606f\u548c Phase2\u3001Phase3 \u7684\u5206\u6bb5\u6267\u884c\u65f6\u95f4\u4fe1\u606f\uff0c\u4ee5\u53ca\u751f\u6210 Phase1 \u5bf9\u5e94 Phase2\u3001Phase3 \u7684\u9636\u6bb5\u8c03\u7528\u4fe1\u606f\u3002<\/p>\n\n\n\n<p><strong>2\u3001\u901a\u8fc7\u53d8\u91cf\u624b\u52a8\u63a7\u5236\u4f5c\u7528\u57df\u3002<\/strong>\u6211\u4eec\u5df2\u77e5\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>TQProfile.Calc \u8fd4\u56de\u4e00\u4e2a TQProfileCalcResult \u7684\u8bb0\u5f55\u503c \uff0c\u5176\u4e2d\u7684 Counter \u6307\u5411\u5f15\u7528\u8ba1\u6570\uff0c\u6211\u4eec\u53ea\u9700\u8981\u5c06\u5b83\u8d4b\u503c\u4e3a\u7a7a\uff0c\u5c31\u53ef\u4ee5\u51cf\u5c11\u5f15\u7528\u8ba1\u6570\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u57fa\u4e8e\u4e0a\u8ff0\u77e5\u8bc6\u70b9\uff0c\u6211\u4eec\u53ef\u4ee5\u5199\u51fa\u4e0b\u9762\u7684\u4ee3\u7801\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>var\n  P1,P2,P3:TQProfileCalcResult;\nbegin\n  P1:=TQProfile.Calc('Phase1');\n  ...\n  if x>100 then\n  begin\n    P2:=TQProfile.Calc('Phase2');\n    ...\n    P2.Counter:=nil;\n  end\n  else\n  begin\n    P3:=TQProfile.Calc('Phase3');\n    ...\n    P3.Counter:=nil;\n  end;\n  P1.Counter:=nil;\nend;<\/code><\/pre>\n\n\n\n<p>\u5176\u6548\u679c\u4e0e\u524d\u9762\u7684\u793a\u4f8b\u4ee3\u7801\u662f\u7b49\u4ef7\u7684\uff0c\u8fd9\u79cd\u63a7\u5236\u65b9\u5f0f\u7684\u4f18\u70b9\u662f\u6211\u4eec\u53ef\u4ee5\u6309\u9700\u8981\u7f29\u51cf\u8861\u91cf\u7684\u4ee3\u7801\u6bb5\u7684\u6570\u636e\u8303\u56f4\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u90fd\u662f\u57fa\u4e8e\u51fd\u6570\u6765\u5206\u6790\u4ee3\u7801\u7684 [&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],"tags":[57],"class_list":["post-5931","post","type-post","status-publish","format-standard","hentry","category-delphi","category-qdac","category-qprofile","tag-57"],"views":1068,"_links":{"self":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/5931","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=5931"}],"version-history":[{"count":2,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/5931\/revisions"}],"predecessor-version":[{"id":5940,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/5931\/revisions\/5940"}],"wp:attachment":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}