The distance a storm is away from you can be calculated by counting the number of seconds it takes to hear thunder associated with lightning. The reason this is possible is that light will reach you almost instantly, but the sound will take longer. Using the difference you can calculate how far away the storm is.