Added performance measurement functions.