logging: put timing functionality into one place.