Starts the timer with the specified name.

If you start and stop the same timer multiple times, the measured intervals
will be accumulated.

@param $name
The name of the timer.
333896
static public function start($name) {
    static::$timers[$name]['start'] = microtime(TRUE);
    static::$timers[$name]['count'] = isset(static::$timers[$name]['count']) ? ++static::$timers[$name]['count'] : 1;
  }
730464
public function clearTimerByName(string $name): bool
    {
        if (!isset($this->timers[$name])) {
            return true;
        }
        unset($this->timers[$name]);
        return true;
    }
639694
static function timer_stop($timer)
    {
        $time = microtime(true);
        if (isset(self::$timers[$timer]))
        {
            if (self::$timers[$timer]["started"])
            {
                if ( function_exists('getrusage'))
                {
                    /// @todo measure resource usage
                }
                self::$timers[$timer]["started"] = false;
                self::$timers[$timer]["value"] = $time - self::$timers[$timer]["value"];
            }
        }
        return false;
    }
181781
public function setName($name)
    {
        $this->name = $name;

        if ($this->id === null) {
            $this->id = $name;
        }
    }
805536
public function block($name)
    {
        $this->currentBlock = $name;

        $this->getBlockQueue()->push($name);

        // Start an output buffer.
        ob_start();
    }
628721
public function setName($name)
    {
        if (in_array($name, Statistics::asArray())) {
            $this->name = $name;
        } else {
            $msg = "The name argument must be a value from the Statistics enumeration, '" . $name . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
725100
public void start(String name) {
        stopLastTimeInstrument();
        StopWatch childSW = new StopWatch(name);
        childTimeInstrumentList.add(childSW);
    }
1089770
public function clearTimerByName(string $name): bool
    {
        if (!isset($this->timers[$name])) {
            return true;
        }
        \Swoole\Timer::clear($this->timers[$name]['tid']);
        unset($this->timers[$name]);

        return true;
    }
1050383
public static void stop(String name) {
        Long start = PENDING.remove(name);
        if (start == null) {
            return;
        }
        long duration = System.currentTimeMillis() - start;
        Counter sum = CUMULATED.computeIfAbsent(name, k -> new Counter(k, "ms"));
        sum.increment(duration);
    }
109149
public static function start($name)
    {
        // Check if machine is running.
        $status = self::status($name);

        if ($status == self::STOPPED) {
            // If not, try to start it.
            return self::runCommand('start', [$name])->isSuccessful();
        }

        return $status == Machine::RUNNING;
    }
780097
public function startAttribute($name, $value)
    {
        $this->checkStartAttribute($name);

        $this->xmlWriter->startAttribute($name);
        $this->xmlWriter->text($value);
    }
954251
public function profileStart($name)
    {
        if (! $this->enable || \is_string($name) === false || empty($name)) {
            return;
        }
        $cid = Coroutine::tid();
        $this->profileStacks[$cid][$name]['start'] = microtime(true);
    }
323960
public function name(string $name)
    {
        $this->name = $name;

        $this->eventDispatcher->emit(
            $this->packageName . '.' . $this->name . '.define', $this
        );
    }
738195
public function setLabel( $name )
	{
		if ( $name == $this->getLabel() ) { return; }

		$this->_values['label'] = (string) $name;
		$this->_modified = true;
	}
717816
public function end(string $name){
        $time   = microtime(true);

        if(!array_key_exists($name, $this->lineStart)){
            throw new \LogicException;
        }

        $this->timeline->addLine(
            $name,
            $this->lineStart[$name] - $this->start,
            $time - $this->lineStart[$name]
        );
    }
112277
public function groupName(string $name): void
    {
        $parts = array_map(
            function ($n) {
                return Inflector::humanize(Inflector::underscore(str_replace('Controller', '', $n)));
            },
            explode('\\', $name)
        );

        /*
        removes empty array entries
         */
        $parts = array_filter($parts);

        /*
        get just the controller and plugin names
         */
        $parts = array_slice($parts, -2);

        $name = implode(' :: ', $parts);

        $this->set('groupName', $name);
    }
978384
public void startTimer(String name) {
        StopWatch sw = new StopWatch();
        sw.start();
        STOP_WATCHES.put(name, sw);
    }