/**
* Returns the resources (time, memory) of the request as a string.
*
* @param bool $getPeakMemory
* @param bool $isRealMemory
* @return string
*/
public static function resourceUsage($getPeakMemory = true, $isRealMemory = false)
{
if ($getPeakMemory) {
$message = 'Time: %s, Peak memory: %s';
$memory = memory_get_peak_usage($isRealMemory);
} else {
$message = 'Time: %s, Memory: %s';
$memory = memory_get_usage($isRealMemory);
}
$memory = FS::format($memory, 2);
$time = Timer::format(Timer::timeSinceStart());
return sprintf($message, $time, $memory);
}