Calculate timed taken for a process to complete.

@param  \Laravie\Profiler\Contracts\Timer|string|null  $name

@return void
163594
public function timeEnd($name = null): void
    {
        $timer = $name instanceof TimerContract ? $name : $this->resolveTimerFromName($name);

        $timer->end();
    }
310131
public function counting($name, $hit, $total = null)
    {
        if (! \is_string($name) || empty($name)) {
            return;
        }

        $cid = Coroutine::tid();
        if (! isset($this->countings[$cid][$name])) {
            $this->countings[$cid][$name] = ['hit' => 0, 'total' => 0];
        }
        $this->countings[$cid][$name]['hit'] += (int)$hit;
        if ($total !== null) {
            $this->countings[$cid][$name]['total'] += (int)$total;
        }
    }
550792
public function removeTick($name)
    {
        if (isset($this->ticks[$name])) {
            $this->ticks[$name]->setManager(null);
            unset($this->ticks[$name]);
        }
    }
391368
public function time(string $name, string $message = null): TimerContract
    {
        $id = isset($this->timers[$name]) ? \uniqid($name) : $name;

        $this->timers[$id] = $this->createTimer($name, \microtime(true), $message);

        return $this->timers[$id];
    }
292888
public function stopTimer($name)
    {
        if (\in_array($name, $this->timers, true) && (strpos($name, '_') === 0 || $this->enabled())) {
            $this->debugbar['time']->stopMeasure($name);
        }

        return $this;
    }
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]
        );
    }
1232859
public static function start($name = "default")
  {
    if(array_key_exists($name, self::$timers))
    {
      self::$timers[$name]->start();
    }
    else
    {
      self::$timers[$name] = new TeamSpeak3_Helper_Profiler_Timer($name);
    }
  }
1108157
public function run(string $name, $parameters = null)
    {
        if ($this->enabled && $this->has($name)) {
            $this->getSwoole()->task([
                'name' => $name,
                'parameters' => $parameters
            ]);
        }
    }
285636
public static function start($name = null) {
		if (! self::isStarted ()) {
			if (isset ( $name ) && $name !== "") {
				self::$name = $name;
			}
			if (isset ( self::$name )) {
				\session_name ( self::$name );
			}
			\session_start ();
		}
	}
144507
protected function setFinished($time = null)
    {
        $this->finished = $time ?: microtime(true);
        $this->setState(RunInterface::STATE_NOT_RUNNING);
    }
704146
public void endTiming(String name, float elapsed) {
		Counter counter = get(name, CounterType.Interval);
		calculateStats(counter, elapsed);
		update();
	}
1373063
private function stopwatch($action, $name)
    {
        if (isset($this->stopwatch)) {
            $this->stopwatch->$action('ongr_es: '.$name, 'ongr_es');
        }
    }
536404
public function profileStart($name)
    {
        if (!is_string($name) || empty($name)) {
            return;
        }

        $this->_profileStacks[$name] = microtime(true);
    }
1111282
public function clearTimerByName(string $name)
    {
        if (!isset($this->timers[$name])) {
            return true;
        }
        foreach ($this->timers[$name] as $tid => $tidVal) {
            \Swoole\Timer::clear($tid);
        }
        unset($this->timers[$name]);

        return true;
    }
730464
public function clearTimerByName(string $name): bool
    {
        if (!isset($this->timers[$name])) {
            return true;
        }
        unset($this->timers[$name]);
        return true;
    }
586108
public function reset($name = null)
    {
        if ($name == null) {
            $this->data = array();
        } else {
            unset($this->data[$name]);
        }
    }
1062418
public function stopMeasure(string $name): void
    {
        if (App::$Debug) {
            App::$Debug->stopMeasure($name);
        }
    }