public function end($name)
    {
        if(!$this->isEnabled()) return;

        $aggregate = 0;

        // if (empty($name))
        //     throw new BenchmarkException("Empty timer name!");
        //
        // if (array_key_exists($name, $this->timers) && !empty($this->timers[$name]['end'])) {
        //     $inc = 1;
        //     while (array_key_exists($name.'-'.$inc, $this->timers) && !empty($this->timers[$name]['end'])) {
        //         $inc++;
        //     }
        //     $name = $name.'-'.$inc;
        // }

        $oldTime = $this->firstTime;
        if (array_key_exists($name, $this->timers))
            $oldTime = $this->timers[$name]['time'];
            //throw new BenchmarkException("Timer name '{$name}' not found! Please call start(...) first!");

        // $this->timers[$name]['end'] = $this->getTime();
        $n = $this->getTime();

        // $this->timers[$name]['time'] = ($this->timers[$name]['end'] - $this->timers[$name]['start'])*1000;
        $time = ($n - $oldTime)*1000;
        if ($this->globalMode)
            // $this->timers[$name]['aggregate'] = ($n - $this->firstTime)*1000;
            $aggregate = ($n - $this->firstTime)*1000;

        // $this->Logger->debug("Timer [{$name}]: {$this->timers[$name]['time']}ms, aggregate {$this->timers[$name]['aggregate']}ms");
        $this->Logger->debug("Timer [{$name}]: {$time}ms".($this->globalMode?", aggregate {$aggregate}ms":""));
        unset($this->timers[$name]);

        return $time;
    }