lightning-distance
Estimate how far away lightning is from the flash-to-thunder delay, plus the standard 30-second safety rule. Pure Rust, no deps.
Sound takes roughly 5 seconds to travel one mile (3 seconds per kilometer), so divide the count by 5 for miles or 3 for kilometers. If the gap is 30 seconds or less, the storm is close enough to be dangerous — go inside and wait 30 minutes after the last thunder.
use ;
let dist = miles; // ~2 miles
let danger = is_dangerous; // true (<=30s)
License: MIT