In the frame K the length l of the rod is related to the time of flight Δt by
l=vΔt
In the reference frame fixed to the rod (frame K′) the proper length l0 of the rod is given by
l0=vΔt′
But l0=l√1−β2=vΔt√1−β2, β=vc
Thus, vΔt′=vΔt√1−β2
So
1−β2=(ΔtΔt′)2 or v=c√1−(ΔtΔt′)2
and l0=c√(Δt′)2−(Δt)2=cΔt′√1−(ΔtΔt′)2