Move logging to after execution to capture time spent