Even as rivals gain ground, McDonald's is accelerating in one key area: the drive-thru.

The Chicago-based burger giant shaved 20 seconds off drive-thru waiting times in 2019, and CEO Chris Kempczinski predicts another 30-second improvement this year. At approximately 253 seconds from start to finish, McDonald's drive-thru outpaces surging competitor Chick-fil-A's 322 seconds but lags Burger King and Wendy's, where customers idle for 235 and 230 seconds, respectively, according to data from trade publication QSR Magazine.

Faster drive-thru times are part of McDonald's strategy to stem declines in customer traffic, which fell in seven of the last eight years. That won't change without a big boost from drive-thrus, which generate two-thirds of McDonald's orders. Speedier service should shrink the line of cars waiting to order, potentially encouraging more customers to pull in.

"You have to make the drive-thru the most efficient part of your business," says David Henkes, a senior principal at Technomic, a Chicago-based market research firm.

But McDonald's investment in new drive-thru technology has yet to pay off in higher customer counts. Store traffic fell last year even as drive-thru times dropped.

As McDonald's speeds up, other fast-food chains are slowing down. The QSR survey data shows industry drive-thru times increased by 20 seconds in 2019. That extends a slowdown over the last several years amid increasing menu complexity and a tighter labor market.

New technologies acquired in 2019 play big roles in McDonald's drive-thru initiative. Some 10,000 McDonald's outlets now have Dynamic Yield—software that tailors drive-thru menus based on weather, restaurant traffic and trending menu items. An undisclosed number also have Apprente, an artificial-intelligence speech-recognition system. McDonald's is betting the systems will minimize congestion, accurately record orders and accelerate drive-thru times.

Despite declining customer counts, sales at McDonald's stores open at least a year rose 5.1 percent during the fourth quarter of 2019. That's one of McDonald's better quarterly sales performances in the last decade.