If we treat Earth's orbit as a perfect circle, then the number of milliseconds in a year would be its circumference. To get to pi then, we just need to divide that by its diameter or 2*its radius. In addition, we have the circumference in ms so we want to convert that into a distance or the radius into ms so we need the speed the Earth is rotating around the sun.
The average radius of the Earth to the Sun is 149,600,000 km so the diameter is 299,200,000 km. Earth's average orbital speed is 30 km/s or 0.03 km/ms. Combining these two numbers to get ms, (299,200,000 km / 0.03 km/ms) = 9,973,333,333.333 ms, which is very nearly 10 billion.