public function endMemoryProfile($key, $sampleRate = 1)
    {
        $end = memory_get_usage();
        if (array_key_exists($key, $this->memoryProfiles)) {
            $memory = ($end - $this->memoryProfiles[$key]);
            $this->memory($key, $memory, $sampleRate);
            unset($this->memoryProfiles[$key]);
        }
    }