If you’re traveling abroad this summer, the time you’ll spend waiting in line to get through Customs & Border Protection (CBP) on your return could be torturous – or it could be pleasantly brief. It all depends on the airport you come back through. A new study from MileCards.com warns that the longest CBP lines will be encountered during July and August, averaging 21 to 22 minutes. Focusing on only the nation’s busiest airports, they determined that the longest waiting times are at Miami, with an average of 27 minutes, but maximum line time there ranges up to 55 minutes. In second place was San Francisco International, with a 24-minute average and maximum line time of 48 minutes; New York JFK also posted average waits of 24 minutes. By contrast, the shortest lines among the busiest international airports were at Phoenix, averaging 10 minutes; close behind Phoenix were Charlotte, Washington Dulles and Atlanta, all with average waiting times of 12 minutes or less. Other advice gleaned from the study: Try to schedule a return flight that doesn’t arrive very early in the morning, as many flights from Asia and Latin America do. For returns from Europe, try to avoid mid-afternoon arrivals. The folks at TravelSkills have gathered the details as well as listing the worst hours to go through Customs at each airport. To view the data, click here.