pub fn calculate_latency_ms(start_ms: i64, end_ms: i64) -> u32
Calculate latency from start and end timestamps.