File "cStopwatch.php"
Full path: /www/arduino/honmoku/1/class/cStopwatch.php
File size: 1.1 KiB (1125 bytes)
MIME-type: text/x-php
Charset: utf-8
<?php
//-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
// ストップウォッチ
// クラス名: cStopwatch
// 備考 :
// 更新 : 2012/10/19 KMK-Teraoka
//-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
class cStopwatch
{
private $_start;
private static $_instance;
//-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
// コンストラクタ
// 更新 : 2012/10/18 KMK-Teraoka
//-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
private function __construct()
{
$this->_start = microtime(true);
}
//-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
// 計測を開始する
// 更新 : 2012/10/18 KMK-Teraoka
//-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
public static function start()
{
if (isset(self::$_instance))
{
return self::$_instance;
}
else
{
return self::$_instance = new self();
}
}
//-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
// デクストラクタ
// 更新 : 2012/10/18 KMK-Teraoka
//-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
public function __destruct()
{
print microtime(true) - $this->_start;
print "[ms]";
}
}
?>