Skip to main content

calculate_progress

Function calculate_progress 

Source
pub fn calculate_progress(position: f64, duration: f64) -> f64
Expand description

Calculate progress percentage from position and duration

§Arguments

  • position - Current position in seconds
  • duration - Total duration in seconds

§Returns

Progress as percentage (0.0 to 100.0), or 0.0 if duration is invalid

§Example

let progress = calculate_progress(45.0, 180.0); // 25.0