Skip to content

Commit

Permalink
fix(console): add pretty format for 'last woken' time
Browse files Browse the repository at this point in the history
Use consistent pretty format for 'last woken' time in task view.

Closes #524
  • Loading branch information
yerke committed Feb 25, 2024
1 parent 4af30f2 commit f472214
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tokio-console/src/view/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,13 @@ 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(Span::from(styles.time_units(
since,
view::DUR_LIST_PRECISION,
None,
)));
wakeups.push(Span::raw(" ago"));
}

waker_stats.push(Spans::from(wakeups));
Expand Down

0 comments on commit f472214

Please sign in to comment.