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 27, 2024
1 parent bdaf05e commit b7ba848
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tokio-console/src/view/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit b7ba848

Please sign in to comment.