Skip to main content

parse_duration

Function parse_duration 

Source
pub fn parse_duration(s: &str) -> Option<Duration>
Expand description

Parse a duration string into Duration.

Supports the following suffixes:

  • ms - milliseconds
  • s - seconds
  • m - minutes
  • h - hours
  • d - days

If no suffix is provided, the value is interpreted as seconds.