Starts a timer. Ideal for logging elapsed time for database queries

@param string $string A string to identify the entry in the log
@param array $context Arbitrary data to log
173467
public function logStart($string, $context = []) {
        if (!$this->enabled) {
            return;
        }

        $this->timer = static::getTime();
        $this->log("Start: ".$string, [
            'elapsed' => 'start'
        ] + $context);
    }
1365311
public function beginError(string $message, array $context = []) {
        return $this->begin(LogLevel::ERROR, $message, $context);
    }
200444
public function error($message, array $context = [])
    {
        $this->checkInitialized();

        foreach ($this->loggers as $logger) {
            $logger->error($message, $context);
        }
    }
52253
public function compareStart($string)
    {
        $lowerString = strtolower($string);
        foreach ($this->tokens as $token) {
            if (strpos($lowerString, strtolower($token)) === 0) {
                $this->found = true;
            }
        }
    }
113694
public function debug($value, array $context = array())
	{
		// If we were given anything other than a string,
		// we'll get readable format of the value.
		if( ! is_string($value))
		{
			$value = print_r($value, true);
		}

		$this->log(LogLevel::DEBUG, $value, $context);
	}
268018
public function emergency($message, array $context = [])
    {
        $this->checkInitialized();

        foreach ($this->loggers as $logger) {
            $logger->emergency($message, $context);
        }
    }
1235497
public function initString($string)
    {
        if (empty($this->cal)) {
            $lines = explode(PHP_EOL, $string);

            $this->initLines($lines);
        } else {
            trigger_error('ICal::initString: Calendar already initialised in constructor', E_USER_NOTICE);
        }

        return $this;
    }
428313
public function debug(string $message, array $context = []){
        if($this->logger !== null){
            $this->logger->debug($message, $context);
        }

        if($this->messagePanel !== null){
            $this->messagePanel->addMessage($message, LogLevel::DEBUG);
        }
    }
978211
public function i($text, $context = array())
    {
        $this->log->info($text, $context);
        $this->emit(self::SIGNAL_INFORMATION_ENTERED);
    }
1090632
public function beginCritical(string $message, array $context = []) {
        return $this->begin(LogLevel::CRITICAL, $message, $context);
    }
1145580
public static function timerMoment($string)
    {
        Pool::createPool();

        // Disabled?
        // We do not use the config settings here, because we do not have any
        // output whatsoever. The config settings are either on or off, during
        // the entire run, meaning the can not be changed (by normal api means)
        // from the outside.
        // We also do not use the static ForcedLog methods here, because they
        // are somewhat time costly.
        if (AbstractController::$analysisInProgress || Config::$disabledByPhp) {
            return;
        }

        AbstractController::$analysisInProgress = true;

        static::$pool->createClass('Brainworxx\\Krexx\\Controller\\TimerController')
            ->noFatalForKrexx()
            ->timerAction($string)
            ->reFatalAfterKrexx();

        AbstractController::$analysisInProgress = false;
    }
989071
public function initializeContext(Context $context)
    {
        if (! $context instanceof WordpressAwareInterface) {
            return;
        }

        $context->setWordpress($this->wordpress);
        $context->setWordpressParameters($this->parameters);
    }
758781
public function timer_start()
    {
        $PAGELOADTIME = microtime();
        $PAGELOADTIME = explode(' ', $PAGELOADTIME);
        $PAGELOADTIME = $PAGELOADTIME[1] + $PAGELOADTIME[0];
        $this->basetime = $PAGELOADTIME;
    }
987042
public function critical($message, array $context = []) {
        $this->logger->critical($this->prefixMessage($message), $context);
    }
751468
protected function logDebug($message, array $context = [])
    {
        $this->hasLogger() === true ?: $this->logger->debug($message, $context);
    }
1300888
public function warning($message, array $context = array())
    {
        if ($this->logger) {
            $context = $this->getLoggerContext($context);

            $this->logger->warning($message, $context);
        }
    }
1296483
public function info($message, array $context = []): void
    {
        $message = $this->interpolate($message, $context);

        if (!$this->startTime) {
            $this->startTime = $this->timer = $_SERVER['REQUEST_TIME_FLOAT'] ?? microtime(true);
        }

        $curTimer = microtime(true);
        $curMemory = memory_get_usage();

        $key = sprintf(
            '%f :: %f :: %d',
            $curTimer - $this->startTime,
            $curTimer - $this->timer,
            $curMemory - $this->memory
        );

        $this->info[$key] = $message;

        $this->timer = $curTimer;
        $this->memory = $curMemory;
    }