public static function calculate()
    {
        foreach (self::$stackLog as &$data) {
            foreach (array('time', 'realmem' /* , 'emalloc' */) as $metric) {
                $data[$metric . '_end_relative'] = $data[$metric . '_end'] - self::$startValues[$metric];
                $data[$metric . '_start_relative'] = $data[$metric . '_start'] - self::$startValues[$metric];
                $data[$metric . '_total'] = $data[$metric . '_end_relative'] - $data[$metric . '_start_relative'];
            }
        }
    }