Added time measurement to logging.