The EM waves travel with the speed of light.You know it is c in vacuum, but different from c in media, having different permittivity / refractive index. These material properties depend on the temperature, so the speed of light in a medium also depends on the temperature. If the speed is different, the distance travelled in the same time is also different.