Added performance monitoring with a timer