1. <ul id="0c1fb"></ul>

      <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
      <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区

      RELATEED CONSULTING
      相關(guān)咨詢
      選擇下列產(chǎn)品馬上在線溝通
      服務(wù)時(shí)間:8:30-17:00
      你可能遇到了下面的問題
      關(guān)閉右側(cè)工具欄

      新聞中心

      這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
      怎么用php實(shí)現(xiàn)計(jì)算程序運(yùn)行時(shí)間的類-創(chuàng)新互聯(lián)

      這篇文章主要介紹“怎么用php實(shí)現(xiàn)計(jì)算程序運(yùn)行時(shí)間的類”,在日常操作中,相信很多人在怎么用php實(shí)現(xiàn)計(jì)算程序運(yùn)行時(shí)間的類問題上存在疑惑,小編查閱了各式資料,整理出簡(jiǎn)單好用的操作方法,希望對(duì)大家解答”怎么用php實(shí)現(xiàn)計(jì)算程序運(yùn)行時(shí)間的類”的疑惑有所幫助!接下來,請(qǐng)跟著小編一起來學(xué)習(xí)吧!

      創(chuàng)新互聯(lián)公司主營(yíng)舒蘭網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營(yíng)網(wǎng)站建設(shè)方案,重慶APP開發(fā)公司,舒蘭h5微信平臺(tái)小程序開發(fā)搭建,舒蘭網(wǎng)站營(yíng)銷推廣歡迎舒蘭等地區(qū)企業(yè)咨詢

      復(fù)制代碼 代碼如下:


      class Timer {
      private $StartTime = 0;//程序運(yùn)行開始時(shí)間
      private $StopTime = 0;//程序運(yùn)行結(jié)束時(shí)間
      private $TimeSpent = 0;//程序運(yùn)行花費(fèi)時(shí)間
      function start(){//程序運(yùn)行開始
      $this->StartTime = microtime();
      }
      function stop(){//程序運(yùn)行結(jié)束
      $this->StopTime = microtime();
      }
      function spent(){//程序運(yùn)行花費(fèi)的時(shí)間
      if ($this->TimeSpent) {
      return $this->TimeSpent;
      } else {
      list($StartMicro, $StartSecond) = explode(" ", $this->StartTime);
      list($StopMicro, $StopSecond) = explode(" ", $this->StopTime);
      $start = doubleval($StartMicro) + $StartSecond;
      $stop = doubleval($StopMicro) + $StopSecond;
      $this->TimeSpent = $stop - $start;
      return substr($this->TimeSpent,0,8)."秒";//返回獲取到的程序運(yùn)行時(shí)間差
      }
      }
      }
      $timer = new Timer();
      $timer->start();
      //...程序運(yùn)行的代碼
      $timer->stop();
      echo "程序運(yùn)行時(shí)間為:".$timer->spent();


      到此,關(guān)于“怎么用php實(shí)現(xiàn)計(jì)算程序運(yùn)行時(shí)間的類”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實(shí)踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識(shí),請(qǐng)繼續(xù)關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編會(huì)繼續(xù)努力為大家?guī)砀鄬?shí)用的文章!


      網(wǎng)頁名稱:怎么用php實(shí)現(xiàn)計(jì)算程序運(yùn)行時(shí)間的類-創(chuàng)新互聯(lián)
      分享鏈接:http://www.ef60e0e.cn/article/cdojoi.html
      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区
      1. <ul id="0c1fb"></ul>

        <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
        <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

        杭州市| 额敏县| 嘉祥县| 库尔勒市| 中西区| 舟山市| 漳州市| 沧州市| 洪江市| 新和县| 松溪县| 铁岭市| 黄梅县| 大姚县| 海淀区| 永新县| 镶黄旗| 盐亭县| 沧州市| 陕西省| 乳山市| 海城市| 南雄市| 伊川县| 宁乡县| 舟曲县| 延川县| 绍兴市| 政和县| 昭通市| 嵩明县| 湛江市| 汪清县| 凌云县| 西贡区| 英德市| 康定县| 宜君县| 乃东县| 定南县| 虎林市|