Travelers with a long layover in Beijng can easily fill their hours exploring the Forbidden City, about an hour from the airport. (Andrea Sachs/The Washington Post)

At the end of a 10-hour layover in Beijing, I found myself begging other passengers for permission to jump the security line. I flourished my ticket with the boarding time of now, thankful that they didn’t know the truth. Having had 600 minutes to make my connecting flight to Washington Dulles, I had no excuse for rushing — except a good one.

When you’re stuck with a layover of such prodigious length, the en-route stop becomes more than just a transit between two points. It turns into a full-fledged destination to visit, including a foot-dragging resistance to leaving.

No one wants to hang out at an airport for six, eight, 12 eternal hours. What makes the layover even harder is knowing that beyond the airport’s sliding doors await cafes, shops, parks, museums, capacious legroom — and fresh air.

Unfortunately, there’s no scientific formula for helping you determine whether to wait it out inside the terminal or to step out for a spell. You need to take into account many variables, such as the airport’s proximity to attractions and ground transportation options. Another consideration: whether you need a visa. (Many countries waive the document for transit visitors; China isn’t one of them, charging $140.)

To plan your layover getaway, work backward. Take your total time (preferably a minimum of four hours) and subtract at least 90 minutes for security. For a foreign country, factor in immigration. Add more time if you need to retrieve bags from a locker or promised your mother a bottle of duty-free gin. Calculate how much time you have left over. Take that figure over to the airport’s information desk and ask the expert behind the counter how long it takes to travel round-trip from the airport to the city (or wherever you wish to go). Now set your watch and flee.

I arrived in Beijing at 8:30 a.m. and didn’t depart for the States until close to 6:30 p.m. The woman at the info station told me that the airport shuttle connects to downtown in less than 30 minutes. From there, I could catch the subway to Lama Temple (one stop away) or to Tiananmen Square (about an hour total via two subway lines). I could follow either route or, if I were particularly efficient, both.

Before leaving the airport, don’t forget to change some money — not too much, not too little. I settled on $20, just enough to cover public transportation ($2 for the shuttle one way, 30 cents per subway ride) and some incidentals, such as temple admission ($2) and a snack or souvenir.

Thanks to my planning, I arrived at Tiananmen without incident, though I did lose valuable minutes waiting for a car that could accommodate an American and two carry-on bags. (Beijing’s subway is a human mash.) Standing in the monumental plaza among herds of mainly Chinese tourists, I studied the line to enter the Mao Memorial Hall. The queue roped around like a hundred dragon tails. I could blow my whole layover just for a peek at the chairman at rest. A key lesson in layover expeditions: Know when to walk away.

Assuming a quicker entry at Lama Temple, I subwayed over to the city’s largest temple, set among the hutongs, or ancient alleyways. I joined a line of one, including me.

Clouds of incense drifted outside the individual halls, the cloying smell clinging to my hair and clothes. (Apologies to my airplane seatmate.) I gave myself an hour to tour the temple but was delinquent at enforcing my own rules. A warning about generous layovers: You will take on risky behavior, stretching out your visit to dangerous lengths.

Though I was down to less than three hours before my flight departed, still I dallied — before the buddhas and in the shops stocked with gift offerings to the blessed figure. I decided that I wanted food for the plane ride. At Xu Xiang Zhai, a vegetarian restaurant, I foolishly tried to ask the server to explain the loofah soup with faux fish maw. I left without an answer, or takeout. Finally, I meandered back to the subway. I was afraid to look at the time and studied my new cloisonne bowl instead.

I arrived at the airport nearly an hour before boarding time. Sooo much time to spare. I had one final (irrational) urge: to take a shower.

The Hourly Lounge in Terminal 3 offers travelers rooms for quick naps, massages and showers. For less than $8, I purchased a hot rinse plus towel, shower cap, shampoo, bath foam and soap. I figured I could be in and out, dried and dressed before first-class was called to the plate. I was all clean but struggled to turn off the water. I called out for help; three employees arrived, equally flummoxed.

By the time I exited the Hourly Lounge, my flight was boarding. I still had to pass through immigration and security and get rid of my remaining yuan. As I took my seat on the plane, I heard the jingle of coins in my pocket.