<#22991 feat: Log elapsed time for completed worku...
# github-notifications
q
#22991 feat: Log elapsed time for completed workunits Issue created by jasonwbarnett Problem When Pants completes a workunit (like generating a lockfile), the log message only shows that it completed, not how long it took:
Copy code
23:17:29.42 [INFO] Completed: Generate lockfile for my-resolve
This makes it difficult to identify slow operations or track performance over time without additional tooling. Solution Log the elapsed time alongside the completion message:
Copy code
23:17:29.42 [INFO] Completed: Generate lockfile for my-resolve (45.23s)
For longer operations (60+ seconds), show minutes:
Copy code
23:17:29.42 [INFO] Completed: Generate lockfile for my-resolve (2m 30.0s)
Additional context This information is already available in the
TimeSpan
stored in
WorkunitState::Completed
, so the implementation is straightforward - just format and include it in the log message. pantsbuild/pants