Skip to content

Instantly share code, notes, and snippets.

@imaz
Last active December 15, 2015 05:49
Show Gist options
  • Save imaz/5211794 to your computer and use it in GitHub Desktop.
Save imaz/5211794 to your computer and use it in GitHub Desktop.
PHP Stopwatch だが stop 機能は無い
<?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