Our local bus companies do it based on old data, not on actual distances. Over time they just logged how long it takes a bus to move between stops.
So in rush hour you can see longer time between two stops than at other hours (and with traffic jams being pretty reliable, those times are also quite reliable). Time spent at stops in rush hour is also much longer (more passengers to board - just the boarding may take 5 minutes - or having to wait for other buses occupying the same stop). Furthermore, estimated time of arrival (as displayed at bus stops) is constantly updated based on actual traffic conditions - so if you see the next bus is due in 5 minutes, it may change to 6 or 7, or suddenly jump to 3.
Traffic movement based on distance + speed is a very rough estimate at best, so your estimates on bus arrival times will be not much more accurate than the official time tables.
As an example, if the bus is 10km away and travelling at 10kmph, how long before it arrives ?
That's simple. 10 and 10, so that's 10 hours. Or was it 10 minutes... Mmm... Maybe I should go back to primary school, but at that time I wasn't using buses much, we did just about everything by bicycle!