Moved pretty elapsed time to a function.