This might be a little bit late but the answer is fairly simple. If you consider the clock frequency as 2Mhz, the person who wrote this code is taking an 8 bit counter (256 counts) to find out the time it takes to fill up the counter. He then multiplies that with the speed of sound in air, giving the distance traveled. All the 10's in the equation are just conversions from one unit to the other.