Function format_duration

Source
pub fn format_duration(buf: BytesMut, ms: u64) -> BytesMut
Expand description

Formats a duration in milliseconds into a human readable string For durations < 1000ms, formats as milliseconds For durations >= 1000ms, formats as seconds with up to one decimal place

§Arguments

  • buf - BytesMut buffer to write the formatted string into
  • ms - Duration in milliseconds to format

§Returns

BytesMut buffer containing the formatted string