{"id":1758,"date":"2015-01-20T00:41:50","date_gmt":"2015-01-19T16:41:50","guid":{"rendered":"http:\/\/blog.qdac.cc\/?p=1758"},"modified":"2015-01-20T00:43:47","modified_gmt":"2015-01-19T16:43:47","slug":"%e5%9f%ba%e4%ba%8e-qworker-%e7%9a%84%e5%a4%9a%e7%ba%bf%e7%a8%8b%e7%bc%96%e7%a8%8b-%e7%ba%bf%e7%a8%8b%e5%ae%9a%e6%97%b6%e5%99%a8","status":"publish","type":"post","link":"https:\/\/blog.qdac.cc\/?p=1758","title":{"rendered":"\u57fa\u4e8e QWorker \u7684\u591a\u7ebf\u7a0b\u7f16\u7a0b &#8211; \u7ebf\u7a0b\u5b9a\u65f6\u5668"},"content":{"rendered":"<p>\u5728\u5b9e\u9645\u7f16\u7a0b\u73af\u5883\u4e2d\uff0c\u6211\u4eec\u5e38\u9700\u8981\u5b9a\u65f6\u6267\u884c\u4e00\u9879\u4efb\u52a1\uff0c\u6bd4\u5982\u6bcf\u96941\u5c0f\u65f6\uff0c\u6267\u884c\u4e00\u6b21\u540c\u6b65\u64cd\u4f5c\uff0c\u800c\u8fd9\u4e9b\u64cd\u4f5c\u5982\u679c\u653e\u5230\u4e3b\u7ebf\u7a0b\u4e2d\u4f7f\u7528\u666e\u901a\u7684 TTimer \u6267\u884c\uff0c\u7531\u4e8e\u9700\u8981\u5360\u7528\u4e3b\u7ebf\u7a0b\u7684\u8d44\u6e90\uff0c\u53ef\u80fd\u4f1a\u9020\u6210\u7a0b\u5e8f\u660e\u663e\u7684\u5361\u987f\u3002\u8fd9\u65f6\u5019\uff0c\u6211\u4eec\u5c31\u9700\u8981\u4f7f\u7528\u540e\u53f0\u5b9a\u65f6\u5668\u6765\u5b8c\u6210\u8fd9\u4e00\u64cd\u4f5c\uff08\u5f53\u7136 QWorker \u4e5f\u652f\u6301\u4e3b\u7ebf\u7a0b\u4e2d\u7684\u5b9a\u65f6\u4f5c\u4e1a\uff0c\u6b64\u65f6\u5c31\u76f8\u5f53\u4e8e\u4f60\u5728\u7a97\u53e3\u4e0a\u653e\u7f6e\u4e86\u4e00\u4e2aTTimer \u63a7\u4ef6\uff09\u3002<\/p>\n<p>QWorker \u63d0\u4f9b\u4e86\u4e09\u79cd\u4e0d\u540c\u7684\u5b9a\u65f6\u65b9\u5f0f\u201c<\/p>\n<p>1\u3001\u4e00\u4e2a\u6700\u666e\u901a\u7684\u5b9a\u65f6\u5668\uff0c\u901a\u8fc7 Post \u6295\u5bc4\u4e00\u4e2a\u5e26\u6709\u65f6\u95f4\u95f4\u9694\u7684\u4f5c\u4e1a\uff0c\u6211\u4eec\u6765\u770b\u5bf9\u5e94\u7684 Post \u51fd\u6570\u7684\u53c2\u6570\uff08\u5168\u5c40\u51fd\u6570\u548c\u533f\u540d\u51fd\u6570\u7248\u672c\u7565\uff0c\u4e0b\u540c\uff09\uff1a<\/p>\n<pre class=\"lang:delphi decode:true \">    \/\/\/ &lt;summary&gt;\u6295\u5bc4\u4e00\u4e2a\u540e\u53f0\u5b9a\u65f6\u5f00\u59cb\u7684\u4f5c\u4e1a&lt;\/summary&gt;\r\n    \/\/\/ &lt;param name=\"AProc\"&gt;\u8981\u6267\u884c\u7684\u4f5c\u4e1a\u8fc7\u7a0b&lt;\/param&gt;\r\n    \/\/\/ &lt;param name=\"AInterval\"&gt;\u8981\u5b9a\u65f6\u6267\u884c\u7684\u4f5c\u4e1a\u65f6\u95f4\u95f4\u9694\uff0c\u5355\u4f4d\u4e3a0.1ms\uff0c\u5982\u8981\u95f4\u96941\u79d2\uff0c\u5219\u503c\u4e3a10000&lt;\/param&gt;\r\n    \/\/\/ &lt;param name=\"AData\"&gt;\u4f5c\u4e1a\u9644\u52a0\u7684\u7528\u6237\u6570\u636e\u6307\u9488&lt;\/param&gt;\r\n    \/\/\/ &lt;param name=\"ARunInMainThread\"&gt;\u4f5c\u4e1a\u8981\u6c42\u5728\u4e3b\u7ebf\u7a0b\u4e2d\u6267\u884c&lt;\/param&gt;\r\n    \/\/\/ &lt;param name=\"AFreeType\"&gt;\u9644\u52a0\u6570\u636e\u6307\u9488\u91ca\u653e\u65b9\u5f0f&lt;\/param&gt;\r\n    \/\/\/ &lt;returns&gt;\u6210\u529f\u6295\u5bc4\u8fd4\u56de\u53e5\u67c4\uff0c\u5426\u5219\u8fd4\u56de0&lt;\/returns&gt;\r\n    function Post(AProc: TQJobProc; AInterval: Int64; AData: Pointer;\r\n      ARunInMainThread: Boolean = False;\r\n      AFreeType: TQJobDataFreeType = jdfFreeByUser): IntPtr; overload;<\/pre>\n<p>\u5728 Post \u65f6\uff0c\u6211\u4eec\u901a\u8fc7 AInterval \u53c2\u6570\uff0c\u6307\u5b9a\u4e00\u4e2a\u65f6\u95f4\u95f4\u9694\u5c31\u53ef\u4ee5\u8fbe\u5230\u5b9a\u65f6\u91cd\u590d\u4f5c\u4e1a\u7684\u76ee\u7684\u4e86\u3002\u6bd4\u5982\u4e0b\u9762\u7684\u4ee3\u7801\uff0c\u6bcf\u79d2\u4f1a\u5728 IDE \u7684 Events \u8c03\u8bd5\u7a97\u53e3\u8f93\u51fa\u5f53\u524d\u65f6\u95f4\uff1a<\/p>\n<p>\u3010Delphi\u3011<\/p>\n<pre class=\"lang:delphi decode:true \">procedure TForm1.DoTheadTimer(AJob: PQJob);\r\nbegin\r\nOutputDebugString(PChar(FormatDateTime('yyyy-mm-dd hh:nn:ss',Now)));\r\nend;\r\n\r\nprocedure TForm1.FormCreate(Sender: TObject);\r\nbegin\r\nWorkers.Post(DoTheadTimer,1*Q1Second,nil);\r\nend;<\/pre>\n<p>\u3010C++ Builder\u3011<\/p>\n<pre class=\"lang:c++ decode:true\">\/\/ \u5934\u6587\u4ef6\u90e8\u5206\u7701\u7565\r\n__fastcall TForm1::TForm1(TComponent* Owner)\r\n\t: TForm(Owner)\r\n{\r\nWorkers-&gt;Post(DoThreadTimer,1*Q1Second,NULL);\r\n}\r\n\/\/---------------------------------------------------------------------------\r\nvoid __fastcall TForm1::DoThreadTimer(PQJob AJob)\r\n{\r\nOutputDebugString(FormatDateTime(\"yyyy-mm-dd hh:nn:ss\",Now()).c_str());\r\n}<\/pre>\n<p>\u5f88\u7b80\u5355\u5427\uff01<\/p>\n<p><span style=\"color: #ff0000;\">\u3010\u6ce8\u610f\u3011 \u8fd9\u4e2a\u5b9a\u65f6\u5668\u4e0d\u4f1a\u7ba1\u4f60\u4f5c\u4e1a\u662f\u5426\u5904\u7406\u5b8c\u6210\uff0c\u6309\u89c4\u5b9a\u7684\u95f4\u9694\u5b9a\u65f6\u6bcf\u79d2\u89e6\u53d11\u6b21\uff0c\u5982\u679c\u4f60\u957f\u65f6\u95f4\u505a\u4e1a\u8d85\u65f6\uff0c\u4f1a\u9020\u6210\u4f5c\u4e1a\u7d2f\u79ef\uff0c\u540e\u679c\u53ef\u80fd\u4f1a~~~~<\/span><\/p>\n<p>2\u3001\u4f7f\u7528 Delay \u8bbe\u7f6e\u81ea\u7531\u5b9a\u65f6\u5668<\/p>\n<p>Delay \u4e0e Post \u4e0d\u540c\uff0cDelay \u5b9e\u9645\u4e0a\u662f\u4e00\u4e2a\u5ef6\u8fdf\u6307\u5b9a\u65f6\u95f4\u6267\u884c\u67d0\u4e00\u64cd\u4f5c\u7684\u4e00\u79cd\u4f5c\u4e1a\u65b9\u5f0f\u3002\u662f\u4e00\u4e2a\u5ef6\u8fdf\u5b9a\u65f6\u5668\u3002\u7531\u4e8e QWorker \u5141\u8bb8\u5728\u4f5c\u4e1a\u4e2d\u6295\u5bc4\u65b0\u4f5c\u4e1a\uff0c\u56e0\u6b64\uff0c\u5728\u8fd9\u4e2a\u4f5c\u4e1a\u5b8c\u6210\u65f6\uff0c\u518d\u6b21\u6295\u5bc4\u4f5c\u4e1a\u5c31\u53ef\u4ee5\u8fbe\u5230\u91cd\u590d\u7684\u76ee\u7684\u3002\u8fd9\u6837\u5b9e\u73b0\u7684\u5b9a\u65f6\u5668\u4e0e\u7b2c\u4e00\u79cd\u65b9\u5f0f\u4e0d\u540c\uff0c\u5b83\u5b9e\u9645\u4e0a\u7c7b\u4f3c\u4e8e\u6211\u4eec\u4f7f\u7528 TTimer \u65f6\uff0c\u5728\u5176 OnTimer \u4e8b\u4ef6\u4e2d\u5148\u901a\u8fc7\u8bbe\u7f6e Enabled \u4e3a False \u7981\u7528 Timer\uff0c\u7136\u540e\u5728\u5904\u7406\u5b8c\u6210\u540e\u518d\u8bbe\u7f6e Enabled \u4e3a True \u542f\u7528\u5b9a\u65f6\u5668\u7684\u6548\u679c\u3002<\/p>\n<p>\u6211\u4eec\u5148\u770b\u4e0b Delay \u51fd\u6570\u7684\u58f0\u660e\uff1a<\/p>\n<pre class=\"lang:delphi decode:true \">    \/\/\/ &lt;summary&gt;\u6295\u5bc4\u4e00\u4e2a\u5ef6\u8fdf\u5f00\u59cb\u7684\u4f5c\u4e1a&lt;\/summary&gt;\r\n    \/\/\/ &lt;param name=\"AProc\"&gt;\u8981\u6267\u884c\u7684\u4f5c\u4e1a\u8fc7\u7a0b&lt;\/param&gt;\r\n    \/\/\/ &lt;param name=\"AInterval\"&gt;\u8981\u5ef6\u8fdf\u7684\u65f6\u95f4\uff0c\u5355\u4f4d\u4e3a0.1ms\uff0c\u5982\u8981\u95f4\u96941\u79d2\uff0c\u5219\u503c\u4e3a10000&lt;\/param&gt;\r\n    \/\/\/ &lt;param name=\"AData\"&gt;\u4f5c\u4e1a\u9644\u52a0\u7684\u7528\u6237\u6570\u636e\u6307\u9488&lt;\/param&gt;\r\n    \/\/\/ &lt;param name=\"ARunInMainThread\"&gt;\u4f5c\u4e1a\u8981\u6c42\u5728\u4e3b\u7ebf\u7a0b\u4e2d\u6267\u884c&lt;\/param&gt;\r\n    \/\/\/ &lt;param name=\"AFreeType\"&gt;\u9644\u52a0\u6570\u636e\u6307\u9488\u91ca\u653e\u65b9\u5f0f&lt;\/param&gt;\r\n    \/\/\/ &lt;returns&gt;\u6210\u529f\u6295\u5bc4\u8fd4\u56de\u53e5\u67c4\uff0c\u5426\u5219\u8fd4\u56de0&lt;\/returns&gt;\r\n    function Delay(AProc: TQJobProc; ADelay: Int64; AData: Pointer;\r\n      ARunInMainThread: Boolean = False;\r\n      AFreeType: TQJobDataFreeType = jdfFreeByUser): IntPtr; overload;<\/pre>\n<p>ADelay \u53c2\u6570\u51b3\u5b9a\u4e86\u4f5c\u4e1a\u5ef6\u8fdf\u7684\u65f6\u95f4\u957f\u5ea6\uff0c\u5355\u4f4d\u4e3a0.1ms\u3002\u4e0b\u9762\u6211\u4eec\u5c31\u901a\u8fc7Delay\u505a\u4e00\u4e2a\u968f\u673a\u5ef6\u8fdf\u7684Demo\uff0c\u8fd9\u4e0a\u4f5c\u4e1a\u7684\u5185\u5bb9\u968f\u673a\u95f4\u96941-3\u79d2\uff0c\u8f93\u51fa\u4e00\u6b21\u5f53\u524d\u65f6\u95f4\uff1a<\/p>\n<p>\u3010Delphi\u3011<\/p>\n<pre class=\"lang:delphi decode:true \">procedure TForm1.DoRandomTimer(AJob: PQJob);\r\nvar\r\n  ANextDelay:Int64;\r\nbegin\r\nOutputDebugString(PChar(FormatDateTime('yyyy-mm-dd hh:nn:ss',Now())));\r\nANextDelay:=Q1Second+Q1Second*random(300) div 100;\r\nWorkers.Delay(DoRandomTimer,ANextDelay,nil);\r\nend;\r\n\r\nprocedure TForm1.FormCreate(Sender: TObject);\r\nbegin\r\nWorkers.Delay(DoRandomTimer,1*Q1Second,nil);\r\nend;<\/pre>\n<p>\u3010C++ Builder\u3011<\/p>\n<pre class=\"lang:c++ decode:true\">__fastcall TForm1::TForm1(TComponent* Owner)\r\n\t: TForm(Owner)\r\n{\r\nWorkers-&gt;Delay(DoRandomTimer,1*Q1Second,NULL);\r\n}\r\n\/\/---------------------------------------------------------------------------\r\nvoid __fastcall TForm1::DoRandomTimer(PQJob AJob)\r\n{\r\nOutputDebugString(FormatDateTime(\"yyyy-mm-dd hh:nn:ss\",Now()).c_str());\r\n__int64 ANextDelay=Q1Second+Q1Second*random(300)\/100;\r\nWorkers-&gt;Delay(DoRandomTimer,ANextDelay,NULL);\r\n}<\/pre>\n<p>3\u3001\u4f7f\u7528 At \u51fd\u6570\u5728\u6307\u5b9a\u7684\u65f6\u95f4\u70b9\u6267\u884c<\/p>\n<p>\u9664\u4e86\u4e0a\u8ff0\u4e24\u79cd\u5b9a\u65f6\u4f5c\u4e1a\u5916\uff0c QWorker \u8fd8\u652f\u6301\u5b9a\u70b9\u4f5c\u4e1a\u3002\u6240\u8c13\u7684\u5b9a\u70b9\u4f5c\u4e1a\u5c31\u662f\u5728\u6307\u5b9a\u7684\u65f6\u95f4\u70b9\u6267\u884c\u7684\u67d0\u7c7b\u4f5c\u4e1a\uff0c\u6bd4\u5982\u6bcf\u5929\u7684 9:30 \u5206\u6267\u884c\uff0c\u6216\u8005\u6bcf\u5c0f\u65f6\u768430\u5206\u6267\u884c\u3002<\/p>\n<p>\u9996\u5148\u6211\u4eec\u6765\u770b At \u51fd\u6570\u7684\u58f0\u660e\uff1a<\/p>\n<pre class=\"lang:delphi decode:true \">    \/\/\/ &lt;summary&gt;\u6295\u5bc4\u4e00\u4e2a\u5728\u6307\u5b9a\u65f6\u95f4\u624d\u5f00\u59cb\u7684\u91cd\u590d\u4f5c\u4e1a&lt;\/summary&gt;\r\n    \/\/\/ &lt;param name=\"AProc\"&gt;\u8981\u5b9a\u65f6\u6267\u884c\u7684\u4f5c\u4e1a\u8fc7\u7a0b&lt;\/param&gt;\r\n    \/\/\/ &lt;param name=\"ADelay\"&gt;\u7b2c\u4e00\u6b21\u6267\u884c\u524d\u5148\u5ef6\u8fdf\u65f6\u95f4&lt;\/param&gt;\r\n    \/\/\/ &lt;param name=\"AInterval\"&gt;\u540e\u7eed\u4f5c\u4e1a\u91cd\u590d\u95f4\u9694\uff0c\u5982\u679c\u5c0f\u4e8e\u7b49\u4e8e0\uff0c\u5219\u4f5c\u4e1a\u53ea\u6267\u884c\u4e00\u6b21\uff0c\u548cDelay\u7684\u6548\u679c\u4e00\u81f4&lt;\/param&gt;\r\n    \/\/\/ &lt;param name=\"ARunInMainThread\"&gt;\u662f\u5426\u8981\u6c42\u4f5c\u4e1a\u5728\u4e3b\u7ebf\u7a0b\u4e2d\u6267\u884c&lt;\/param&gt;\r\n    \/\/\/ &lt;param name=\"AFreeType\"&gt;\u9644\u52a0\u6570\u636e\u6307\u9488\u91ca\u653e\u65b9\u5f0f&lt;\/param&gt;\r\n    \/\/\/ &lt;returns&gt;\u6210\u529f\u6295\u5bc4\u8fd4\u56de\u53e5\u67c4\uff0c\u5931\u8d25\u8fd4\u56de0&lt;\/returns&gt;\r\n    function At(AProc: TQJobProc; const ADelay, AInterval: Int64;\r\n      AData: Pointer; ARunInMainThread: Boolean = False;\r\n      AFreeType: TQJobDataFreeType = jdfFreeByUser): IntPtr; overload;\r\n    \/\/\/ &lt;summary&gt;\u6295\u5bc4\u4e00\u4e2a\u5728\u6307\u5b9a\u65f6\u95f4\u624d\u5f00\u59cb\u7684\u91cd\u590d\u4f5c\u4e1a&lt;\/summary&gt;\r\n    \/\/\/ &lt;param name=\"AProc\"&gt;\u8981\u5b9a\u65f6\u6267\u884c\u7684\u4f5c\u4e1a\u8fc7\u7a0b&lt;\/param&gt;\r\n    \/\/\/ &lt;param name=\"ATime\"&gt;\u6267\u884c\u65f6\u95f4&lt;\/param&gt;\r\n    \/\/\/ &lt;param name=\"AInterval\"&gt;\u540e\u7eed\u4f5c\u4e1a\u91cd\u590d\u95f4\u9694\uff0c\u5982\u679c\u5c0f\u4e8e\u7b49\u4e8e0\uff0c\u5219\u4f5c\u4e1a\u53ea\u6267\u884c\u4e00\u6b21\uff0c\u548cDelay\u7684\u6548\u679c\u4e00\u81f4&lt;\/param&gt;\r\n    \/\/\/ &lt;param name=\"ARunInMainThread\"&gt;\u662f\u5426\u8981\u6c42\u4f5c\u4e1a\u5728\u4e3b\u7ebf\u7a0b\u4e2d\u6267\u884c&lt;\/param&gt;\r\n    \/\/\/ &lt;param name=\"AFreeType\"&gt;\u9644\u52a0\u6570\u636e\u6307\u9488\u91ca\u653e\u65b9\u5f0f&lt;\/param&gt;\r\n    \/\/\/ &lt;returns&gt;\u6210\u529f\u6295\u5bc4\u8fd4\u56de\u53e5\u67c4\uff0c\u5931\u8d25\u8fd4\u56de0&lt;\/returns&gt;\r\n    function At(AProc: TQJobProc; const ATime: TDateTime;\r\n      const AInterval: Int64; AData: Pointer; ARunInMainThread: Boolean = False;\r\n      AFreeType: TQJobDataFreeType = jdfFreeByUser): IntPtr; overload;<\/pre>\n<p>\u7b2c\u4e00\u79cd\u5f62\u5f0f\u4e0b\uff0c\u91c7\u7528\u7684\u548c Delay \u7c7b\u4f3c\u7684\u5f62\u5f0f\uff0c\u6548\u679c\u7b49\u4ef7\u4e8e Delay + Post\u5b9a\u65f6\u91cd\u590d\u7684\u6548\u679c\u3002\u9996\u6b21\u8fd0\u884c\u4f1a\u5ef6\u8fdf ADelay*0.1ms\uff0c\u7136\u540e\u6bcf\u6b21\u6309 AInterval \u7684\u65f6\u95f4\u95f4\u9694\u4e3a\u57fa\u51c6\u8fdb\u884c\u91cd\u590d\u3002\u5982\u679c AInterval \u53c2\u6570\u6307\u5b9a\u4e3a0\uff0c\u5219\u548c Delay \u7684\u6548\u679c\u662f\u5b8c\u5168\u7b49\u4ef7\u7684\u3002<\/p>\n<p>\u7b2c\u4e8c\u79cd\u5f62\u5f0f\u4e0b\uff0c\u4f5c\u4e1a\u9996\u6b21\u4f1a\u5728\u6307\u5b9a\u7684\u65f6\u95f4\u70b9\u6267\u884c\uff0c\u7136\u540e\u518d\u4ee5 AInterval \u6307\u5b9a\u7684\u65f6\u95f4\u95f4\u9694\u8fdb\u884c\u91cd\u590d\u4f5c\u4e1a\u3002\u5982\u679c\u6307\u5b9a\u7684\u65f6\u95f4\u5df2\u7ecf\u8fc7\u4e86\uff0c\u5219\u8ba1\u5212\u4e0b\u4e00\u6b21\u6267\u884c\u65f6\u95f4\u3002<\/p>\n<p>\u4e0b\u9762\u7684\u4ee3\u7801\u5c06\u8ba1\u5212 DoAtJob \u4f5c\u4e1a\u6bcf\u5929\u7684 9:30 \u6267\u884c\u4e00\u6b21\u3002<\/p>\n<p>\u3010Delphi\u3011<\/p>\n<pre class=\"lang:delphi decode:true\">Workers.At(DoAtJob,EncodeTime(9,30,0,0),Q1Day,nil);<\/pre>\n<p>\u3010C++ Builder\u3011<\/p>\n<pre class=\"lang:c++ decode:true \">Workers-&gt;At(DoAtJob,EncodeTime(9,30,0,0),Q1Day,NULL);<\/pre>\n<p>\u4e0b\u9762\u662f\u5173\u4e8e At \u51fd\u6570\u7684\u4e00\u4e9b\u6280\u5de7\u63d0\u793a\uff1a<\/p>\n<p>1\u3001\u5e38\u89c1\u7684\u65f6\u95f4\u95f4\u9694\u53ef\u4ee5\u76f4\u63a5\u7528 Q1XXXX \u4e58\u4ee5\u6570\u91cf\u6765\u8ba1\u7b97\uff0c\u5982\u6bcf\u96942\u5c0f\u65f6\u6267\u884c\u4e00\u6b21\uff0c\u5219 AInterval \u53c2\u6570\u4e3a 2*Q1Hour\uff0c\u6bcf\u96941\u5468\u6267\u884c\u4e00\u6b21\uff0c\u5219 AInterval \u4e3a 7*Q1Day\u3002<\/p>\n<p>2\u3001\u7531\u4e8e\u6bcf\u5e74\u3001\u6bcf\u5b63\u5ea6\u548c\u6bcf\u6708\u7684\u65f6\u957f\u4e0d\u4e00\u6837\uff0c\u6240\u4ee5\u4f60\u65e0\u6cd5\u76f4\u63a5\u7528At\u51fd\u6570\u6765\u89c4\u5212\u8fd9\u79cd\u4f5c\u4e1a\uff0c\u8fd9\u79cd\u4f5c\u4e1a\u7684\u8bdd\uff0c\u5efa\u8bae\u4f60\u76f4\u63a5\u7528At \u5355\u6b21\u4f5c\u4e1a\u5b9e\u73b0\uff0c\u5728\u4e00\u6b21\u4f5c\u4e1a\u5b8c\u6210\u65f6\uff0c\u7528 IncYear \u6216 IncMonth \u6765\u5728\u6307\u5b9a\u7684\u65f6\u95f4\u70b9\u8ba1\u5212\u4e0b\u4e00\u6b21\u4f5c\u4e1a\u3002<\/p>\n<p>\u597d\u4e86\uff0c\u4e0b\u9762\u662f\u5173\u4e8e QWorker \u4e2d\u65f6\u95f4\u95f4\u9694\u7684\u4e00\u4e2a\u8bf4\u660e\uff1a<\/p>\n<p>QWorker \u4e2d\u65f6\u95f4\u95f4\u9694\u7684\u5355\u4f4d\u662f 0.1ms\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u5728\u64cd\u4f5c\u7cfb\u7edf\u652f\u6301\u7684\u60c5\u51b5\u4e0b\uff0c QWorker \u7684\u4f5c\u4e1a\u6700\u5feb\u80fd\u591f 0.1ms \u8c03\u5ea61\u6b21\uff08\u5982\u679c\u4f60\u7684\u4f5c\u4e1a\u6267\u884c\u65f6\u95f4\u672c\u8eab\u5c31\u8d85\u8fc7 0.1ms \u7684\u8bdd\u5c31\u522b\u8003\u8651\u4e86\uff09\uff0c\u800c QWorker \u4f7f\u7528\u4e86\u4e00\u4e2a64\u4f4d\u6574\u6570\u6765\u5bf9\u65f6\u95f4\u95f4\u9694\u8fdb\u884c\u8ba1\u6570\uff0c\u6240\u4ee5\u7406\u8bba\u4e0a\uff0cQWorker \u7684\u65f6\u95f4\u95f4\u9694\u6700\u5927\u7ea6\u4e3a10675199116\u5929\uff0c\u7ea6\u54082923\u5e74\uff0c\u6240\u4ee5\u4e0d\u7528\u62c5\u5fc3\u4f60\u7684\u65f6\u95f4\u6ea2\u51fa\u7684\u95ee\u9898\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5b9e\u9645\u7f16\u7a0b\u73af\u5883\u4e2d\uff0c\u6211\u4eec\u5e38\u9700\u8981\u5b9a\u65f6\u6267\u884c\u4e00\u9879 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","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,6],"tags":[57],"class_list":["post-1758","post","type-post","status-publish","format-standard","hentry","category-delphi","category-qworker","tag-57"],"views":4512,"_links":{"self":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/1758","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=1758"}],"version-history":[{"count":3,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/1758\/revisions"}],"predecessor-version":[{"id":1791,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/1758\/revisions\/1791"}],"wp:attachment":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1758"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1758"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1758"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}