I've actually done this previously (I need to update my own records) and here's the method I use:
Take the two laps before and the two laps after your pit stop. Here's my lead driver's times from his first stop in Australia this season:
- 1:24.850
- 1:40.684
- PIT
- 1:28.038
- 1:24.667
Take the in-lap and out-lap and add them together:
- 1:40.684 + 1:28.038 = 2:68.722 = 3:08.722
And then subtract from that the sum of the laps before the in-lap and after the out-lap (which basically gives an average of the two, and an estimate of your times had you not pitted):
- 3:08.722 - (1:24.850 + 1:24.667) = 3:08.722 - 2:49.517 = 188.722s - 169.517s = 19.205 seconds
... for a delta of 19.205 in my case. Keep in mind this is just an estimate. It will also be different depending on traffic (you tend to lose about 0.3s if you get overtaken by a car), and Hards will be slower on the delta - 5/5 on Softs is quicker than 5/5 on Hards everywhere when you're heating your tires. You can however use this estimate to try to figure out where you'll end up rejoining the field after a stop. Take your current gap to lead plus the delta for your estimate. If you're leading, delta time minus gap back to second place for post-pit gap.