pub fn duration_to_ticks( ticks_hz: Hertz, duration: &Duration, ) -> Result<u16, EspError>
A utility to convert a duration into ticks, depending on the clock ticks.