pub fn human_time_to_ns(human_time: &str) -> Result<i64> {
    if human_time == "" || human_time == "0" {
        return Ok(0);
    }

    let d: humantime::Duration = human_time
        .parse::<humantime::Duration>()
        .map_err(|e| anyhow!(e))?
        .into();

    Ok(d.as_nanos() as i64)
}
// Convert a human time fornat (like "2s") into the equivalent number
// of nano seconds.
Convert a human time fornat (like "2s") into the equivalent number
of nano seconds.
Convert a human time fornat ( like " 2s " ) into the equivalent number of nano seconds .
pub fn human_time_to_ns(human_time: &str) -> Result<i64> {
    if human_time == "" || human_time == "0" {
        return Ok(0);
    }
    let d: humantime::Duration = human_time
        .parse::<humantime::Duration>()
        .map_err(|e| anyhow!(e))?
        .into();
    Ok(d.as_nanos() as i64)
}
pub fn human_time_to_ns ( human_time : & str ) -> Result < i64 > { if human_time == " " || human_time == " " { return Ok ( 0 ) ; } let d : humantime :: Duration = human_time . parse :: < humantime :: Duration > ( ) . map_err ( | e | anyhow ! ( e ) ) ? . into ( ) ; Ok ( d . as_nanos ( ) as i64 ) }
Convert a human time fornat (like "2s") into the equivalent number
of nano seconds.
Convert a human time fornat ( like " 2s " ) into the equivalent number of nano seconds .
human_time
&str
human_time
&str