Niles and Bob sailed at the same time for the same length of time. Niles' sailboat traveled 60 miles at a speed of 10 mph, while Bob's motorboat traveled 120 miles at a speed of 20 mph. For how long were Niles and Bob traveling?