public function start($name, $preset = null, $isGlobalStart = false)
    {
        if(!$this->isEnabled()) return;

        // if(empty($name))
        //     throw new BenchmarkException("Empty timer name!");
        //
        // $name = $this->uniqueTimerName($name);

        $t = $this->getTime();

        $this->timers[$name] = array(
            'name'        => $name,
            // 'start'       => $preset == null ? $t : $preset,
            // 'end'         => null,
            'time'        => $preset == null ? $t : $preset,
            'aggregate'   => null,
            // 'checkpoints' => array()
        );

        if (!$this->globalMode && $isGlobalStart) {
            $this->globalMode = true;
            $this->firstTime  = $this->timers[$name]['time'];
        }

        return $name;
    }
public function start($name, $preset = null, $isGlobalStart = false)
    {
        if(!$this->isEnabled()) return;

        // if(empty($name))
        //     throw new BenchmarkException("Empty timer name!");
        //
        // $name = $this->uniqueTimerName($name);

        $t = $this->getTime();

        $this->timers[$name] = array(
            'name'        => $name,
            // 'start'       => $preset == null ? $t : $preset,
            // 'end'         => null,
            'time'        => $preset == null ? $t : $preset,
            'aggregate'   => null,
            // 'checkpoints' => array()
        );

        if (!$this->globalMode && $isGlobalStart) {
            $this->globalMode = true;
            $this->firstTime  = $this->timers[$name]['time'];
        }

        return $name;
    }
public function start ( $ name , $ preset = null , $ isGlobalStart = false ) { if ( ! $ this -> isEnabled ( ) ) return ; // if(empty($name)) //     throw new BenchmarkException("Empty timer name!"); // // $name = $this->uniqueTimerName($name); $ t = $ this -> getTime ( ) ; $ this -> timers [ $ name ] = array ( 'name' => $ name , // 'start'       => $preset == null ? $t : $preset, // 'end'         => null, 'time' => $ preset == null ? $ t : $ preset , 'aggregate' => null , // 'checkpoints' => array() ) ; if ( ! $ this -> globalMode && $ isGlobalStart ) { $ this -> globalMode = true ; $ this -> firstTime = $ this -> timers [ $ name ] [ 'time' ] ; } return $ name ; }
Starts a timer with the given name

The {@link $preset} parameter is useful for starting a timer for a
process that begin before the Benchmark instance was available, ex.
at the start of the entire request

The {@link $isGlobalStart} parameter is required if you'd like
{@link getTotals()} to return aggregate times for each stored timer.
Enables aggregation mode where every timer end will also store time in
relation to the entire request.

Upon starting a timer by the same name as a previously stored timer,
this function will auto-increment the {@link $name} with a numeric digit
ex. 'timer-2'.

@param string  $name          Name of timer
@param int     $preset        If not null, Unix timestamp with microseconds
to store as the start time
@param boolean $isGlobalStart Whether or not this timer begins the entire
request, used for aggregate profiling in {@link getTotals()}

@return string Timer name
Starts a timer with the given name