Eliot and William go running. Eliot ran for 8 miles, and William ran for 12 miles. Eliot finished his run in 40 fewer minutes than William. If they run at the same speed, for how long did William run?