public function getTotalElapsedTime($decimals = null)
    {
        $totalElapsedTime = 0;
        foreach ($this->getProfiles() as $profile) {
            if ($profile->hasStopped()) {
                $totalElapsedTime += $profile->getElapsedTime();
            }
        }

        if ($decimals) {
            return number_format($totalElapsedTime, $decimals);
        } else {
            return $totalElapsedTime;
        }
    }