This is a global context manager measuring the total memory occupation and total running time for the whole task.