Changeset 18625 for branches/comu-ver2


Ignore:
Timestamp:
2010/04/25 13:28:55 (14 years ago)
Author:
Seasoft
Message:

#709(管理モード時の処理時間の表示をミリ秒単位に)実装

Location:
branches/comu-ver2/data/class
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/data/class/SC_View.php

    r18596 r18625  
    6868 
    6969        if(ADMIN_MODE == '1') { 
    70             $this->time_start = time(); 
     70            $this->time_start = SC_Utils_Ex::sfMicrotimeFloat(); 
    7171        } 
    7272 
     
    135135        $this->_smarty->display($template); 
    136136        if(ADMIN_MODE == '1') { 
    137             $time_end = time(); 
     137            $time_end = SC_Utils_Ex::sfMicrotimeFloat(); 
    138138            $time = $time_end - $this->time_start; 
    139             print("処理時間:" . $time . "秒"); 
     139            echo '処理時間: ' . round($time, 3) . 秒; 
    140140        } 
    141141    } 
  • branches/comu-ver2/data/class/util/SC_Utils.php

    r18569 r18625  
    23332333        return (array)include_once $filenamePluginInfo; 
    23342334    } 
     2335 
     2336    /** 
     2337     * 現在の Unix タイムスタンプを float (秒単位) でマイクロ秒まで返す 
     2338     * 
     2339     * PHP4の上位互換用途。 
     2340     * FIXME PHP4でテストする。(現状全くテストしていない。) 
     2341     * @param SimpleXMLElement $pluginsXml プラグイン XML 
     2342     * @return integer ファイルに書き込まれたバイト数を返します。 
     2343     */ 
     2344    function sfMicrotimeFloat() { 
     2345        $microtime = microtime(true); 
     2346        if (is_string($microtime)) { 
     2347            list($usec, $sec) = explode(" ", microtime()); 
     2348            return ((float)$usec + (float)$sec); 
     2349        } 
     2350        return $microtime; 
     2351    } 
     2352 
    23352353} 
    23362354?> 
Note: See TracChangeset for help on using the changeset viewer.