Last active
December 15, 2015 05:49
-
-
Save imaz/5211794 to your computer and use it in GitHub Desktop.
PHP Stopwatch だが stop 機能は無い
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Stopwatch | |
{ | |
private $_now; | |
public function __construct() | |
{ | |
} | |
public function start() | |
{ | |
$this->_now = microtime(true)*1000; | |
echo("start"); | |
} | |
public function dump() | |
{ | |
$before = $this->_now; | |
$this->_now = microtime(true)*1000; | |
$diff = $this->_now - $before; | |
echo($diff); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment