Note that /usr/bin/time must be available for recording time and mem.