Added debug code to measure render duration.