{"id":69088,"date":"2020-04-20T12:06:43","date_gmt":"2020-04-20T04:06:43","guid":{"rendered":"http:\/\/4563.org\/?p=69088"},"modified":"2020-04-20T12:06:43","modified_gmt":"2020-04-20T04:06:43","slug":"php%e5%88%86%e9%a1%b5%e4%bb%a5%e5%90%8ecpu%e7%88%86%e8%a1%a8%e6%80%8e%e4%b9%88%e5%8a%9e%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=69088","title":{"rendered":"php\u5206\u9875\u4ee5\u540eCPU\u7206\u8868\u600e\u4e48\u529e\uff1f"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>icefog<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 29&nbsp;\u5206\u949f\u524d\t<\/p>\n<h3>php\u5206\u9875\u4ee5\u540eCPU\u7206\u8868\u600e\u4e48\u529e\uff1f<\/h3>\n<p>  \t\t\u4ee3\u7801\u5982\u4e0b\uff0c\u538b\u529b\u6d4b\u8bd5\uff0c200\u4eba\u540c\u65f6\u5728\u7ebf\u5c31CPU\u7206\u8868100%\uff0c\u7f51\u9875\u76f4\u63a5\u5d29\u6e83\u4e86<br \/>  CPU\u662fI5-2400<br \/>  \u5728\u4e0d\u6362\u673a\u5668\u7684\u60c5\u51b5\u4e0b\uff0c\u6709\u4ec0\u4e48\u529e\u6cd5\u53ef\u4ee5\u51cf\u8f7bCPU\u538b\u529b\uff1f<br \/>  &lt;?php <\/p>\n<p>  \/\/\u9700\u8981\u5206\u9875\u7684\u6570\u636e <br \/>  $data = &quot;\u6536\u5230\u9700\u8981\u8d76,\u5feb\u56de\u590d\u7684\u4fe1,\u606f \u90a3\u5c31\u8003\u8651\u770b\u770b\u662f\u4e0d\u662f\u8981\u56de\u5e94\u4f60 \u5982\u679c\u8bf4\u4ee5\u540e\u90fd\u4e0d\u7528\u5bf9\u4f60\u8bb2\u5ba2\u6c14 \u6211\u5c31\u7b49\u7740\u5bf9\u4f60\u8bf4\u4e00\u53e5\u6b22\u8fce\u5149\u4e34 \u5728\u65e0\u4eba\u7684\u6d77\u5c9b\u4e0a\u6709\u7f8e\u4e3d\u98ce\u666f \u60f3\u6709\u68a6\u91cc\u7684\u7af9\u873b\u8713\u5e26\u6211\u53bb\u8fdc\u884c \u53bb\u5230\u4f60\u5fc3\u91cc\u7684\u90a3\u4e2a\u795e\u79d8\u7684\u5df4\u9ece, \u518d\u60f3\u548c\u4f60\u751f\u4e00\u7fa4Baby \u6211\u5f00\u59cb\u7f8e\u4e3d\u7684\u9645\u9047 \u4f60\u6765\u81ea\u4e1c\u6216\u897f \u90fd\u6ca1\u6709\u592a\u5927\u7684\u5173\u7cfb \u90fd\u542c\u4f60 \u56e0\u4e3a\u59cb\u7ec8\u548c\u4f60\u524d\u8fdb \u56de\u5fc6\u5e76\u80a9\u65c5\u884c \u6211\u613f\u610f\u966a\u7740\u4f60\u53bb\u4e1c\u548c\u897f \u6536\u5230\u9700\u8981\u8d76\u5feb\u56de\u590d\u7684\u4fe1\u606f \u90a3\u5c31\u8003\u8651\u770b\u770b\u662f\u4e0d\u662f\u8981\u56de\u5e94\u4f60 \u5982\u679c\u8bf4&quot;; <br \/>  \/\/\u5f53\u524d\u6587\u7ae0\u9875 <br \/>  $fenye = isset($_GET[&#8216;fenye&#8217;]) ? intval($_GET[&#8216;fenye&#8217;]) : 0; <br \/>  \/\/\u5206\u9875\u957f\u5ea6 <br \/>  $perpage = 89; <br \/>  \/\/\u663e\u793a\u5728\u9875\u9762\u7684\u4ee3\u7801 <br \/>  $offset = ($fenye) * $perpage;<br \/>  $link = &#8221;; <br \/>  $strNum = ceil(mb_strlen($data) \/ $perpage);<br \/>  \/\/\u6309\u5b57\u7b26\u5206\u5272 <br \/>  \/\/$delimiter = &quot;n&quot;; <br \/>  \/\/ $delimiter = &#8216;&lt;&#8211;pagination&#8211;&gt;&#8217;; <br \/>  \/\/$strArr = explode($delimiter, $data); <br \/>  $content = mb_substr($data, $offset, $perpage, &#8216;utf-8&#8217;);<br \/>  if ($strNum &gt; 1) { <br \/>  if ($fenye != 0) { <br \/>  $link .= &#8216;&lt;a href=&quot;?action=article&amp;id={$id}&amp;fenye=0&quot;&gt;\u9996\u9875&lt;\/a&gt;&#8217;; <br \/>  } else { <br \/>  $link .= &#8216;&lt;span&gt;\u9996\u9875&lt;\/span&gt;&#8217;; <br \/>  } <br \/>  for ($n = 0; $n &lt; $strNum; $n++) { <br \/>  if ($n == $fenye) { <br \/>  $link .= &#8216;&lt;span&gt;&#8217; . ($n + 1) . &#8216;&lt;\/span&gt;&#8217;; <br \/>  } else { <br \/>  $link .= &quot;&lt;a href=&#8217;?action=article&amp;id={$id}&amp;fenye={$n}&#8217;&gt;&quot; . ($n + 1) . &quot;&lt;\/a&gt;&quot;; <br \/>  } <br \/>  } <br \/>  $link .= &#8221;; <br \/>  if ($fenye != ($strNum &#8211; 1)) { <br \/>  $link .= &quot;&lt;a href=&#8217;?action=article&amp;id={$id}&amp;fenye=&quot; . ($strNum &#8211; 1) . &quot;&#8217;&gt;\u5c3e\u9875&lt;\/a&gt;&quot;; <br \/>  } else { <br \/>  $link .= &#8216;&lt;span&gt;\u5c3e\u9875&lt;\/span&gt;&#8217;; <br \/>  } <br \/>  } <br \/>  ?&gt;<br \/>  &lt;!DOCTYPE HTML&gt; <br \/>  &lt;html lang=&quot;en-US&quot;&gt; <br \/>  &lt;head&gt; <br \/>  &lt;meta charset=&quot;UTF-8&quot;&gt; <br \/>  &lt;style type=&quot;text\/css&quot;&gt; <br \/>  body { <br \/>  font-family: &#8216;\u5fae\u8f6f\u96c5\u9ed1&#8217;; <br \/>  } <br \/>  .link a, span { <br \/>  margin: 1px; <br \/>  padding: 1px; <br \/>  } <br \/>  .link span { <br \/>  color: #777; <br \/>  } <br \/>  .link a { <br \/>  color: #26A2DA; <br \/>  text-decoration: none; <br \/>  } <br \/>  &lt;\/style&gt; <br \/>  &lt;title&gt;\u6d4b\u8bd5\u6587\u7ae0\u5206\u9875&lt;\/title&gt; <br \/>  &lt;\/head&gt; <br \/>  &lt;body&gt; <br \/>  &lt;h1&gt;&lt;?php echo $title; ?&gt;&lt;\/h1&gt; <br \/>  &lt;p&gt;&lt;?php echo $content; ?&gt;&lt;\/p&gt; <br \/>  &lt;p&gt;&lt;?php echo $strNum; ?&gt;&lt;\/p&gt; <br \/>  &lt;hr \/&gt; <br \/>  &lt;p class=&quot;link&quot;&gt;&lt;?php echo $link; ?&gt;&lt;\/p&gt; <br \/>  &lt;\/body&gt; <br \/>  &lt;\/html&gt;\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>tir<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 28&nbsp;\u5206\u949f\u524d\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u63a8\u8350\u52a0\u94b1\u4e0a\u8d1f\u8f7d\u5747\u8861\u554a\uff0c\u5c0f\u95ee\u9898\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>kang800<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 28&nbsp;\u5206\u949f\u524d\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u90a3\u5c31 \u4e0d\u5206\u5457<br \/>  \u6216\u8005\u9759\u6001\u5316\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>fengshu<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 21&nbsp;\u5206\u949f\u524d\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u51b2\u94b1\u5427\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u674e\u6c81\u5cf0<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 17&nbsp;\u5206\u949f\u524d\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u9759\u6001\u5316\uff0c\u6700\u597d\u89e3\u51b3\u529e\u6cd5\u3002\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>icefog \u5927\u4f6c\u6709\u8bdd\u8bf4 : 29&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/69088"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=69088"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/69088\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=69088"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=69088"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=69088"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}