From b7ba84894e358b9e6409aedaf1ed32f0e234a52f Mon Sep 17 00:00:00 2001 From: Yerkebulan Tulibergenov Date: Fri, 23 Feb 2024 21:05:16 -0800 Subject: [PATCH] fix(console): add pretty format for 'last woken' time Use consistent pretty format for 'last woken' time in task view. Closes #524 --- tokio-console/src/view/task.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tokio-console/src/view/task.rs b/tokio-console/src/view/task.rs index 8f3024520..8a6494464 100644 --- a/tokio-console/src/view/task.rs +++ b/tokio-console/src/view/task.rs @@ -204,8 +204,9 @@ impl TaskView { if let Some(since) = task.since_wake(now) { wakeups.reserve(3); wakeups.push(Span::raw(", ")); - wakeups.push(bold("last woken:")); - wakeups.push(Span::from(format!(" {:?} ago", since))); + wakeups.push(bold("last woken: ")); + wakeups.push(styles.time_units(since, view::DUR_LIST_PRECISION, None)); + wakeups.push(Span::raw(" ago")); } waker_stats.push(Spans::from(wakeups));