Jyxo\Timer::start PHP Method

start() public static method

Starts measuring. Returns timer name.
public static start ( string $name = '' ) : string
$name string Custom timer name
return string
    public static function start(string $name = '') : string
    {
        $start = microtime(true);
        if (empty($name)) {
            $name = md5($start . rand(0, 100));
        }
        self::$starts[$name] = $start;
        return $name;
    }

Usage Example

Beispiel #1
0
 /**
  * Starts profiling.
  *
  * @return \Jyxo\Rpc\Client
  */
 protected function profileStart()
 {
     // Set start time
     if ($this->profiler) {
         $this->timer = \Jyxo\Timer::start();
     }
     return $this;
 }
All Usage Examples Of Jyxo\Timer::start