Is the fast-food industry signaling an economic downturn?

If you want to get a read on Americans' view of the economy, look at how they eat.

Restaurant visits serve as a barometer for consumer confidence, with people cutting back on dining out when times are tough or they're worried about the future. And after several years of solid growth in the fast-food industry, U.S. consumers are again reducing how often they go out to eat, according to data from market research firm NPD Group.

Visits to fast-food restaurants were flat in March, April and May. Perhaps even more surprising, the "fast-casual" segment -- restaurants such as Panera (PNRA) that are slightly more expensive than fast food chains -- saw traffic decline 2 percent in the three-month period. That follows previous strong growth of between 7 percent to 9 percent for each of the last several quarters. The decline in May excludes results for Chipotle (CMG), which had seen a fall-off in business following E. coli and norovirus outbreaks.

"It's a red flag to me and it bears watching," said Bonnie Riggs, a food industry analyst with NPD. "It's a very unsettling time for consumers right now. They don't know what's going to happen, so they are pulling back a little."

Added Riggs, commenting on the slow economic growth in the first quarter. "GDP is barely up 1 percent. That's not a good sign at all. Three percent or more is a good indicator of economic growth. One percent is really very sluggish, and many consumers believe we never came out of a recession."

Consumer confidence was flat in May, according to Gallup, which found that Americans' faith in the economy so far this year has been lower than comparable months in 2015. Concerns about the presidential election, Britain's decision to leave the European Union and sluggish wage growth may all be contributing to some consumers' gloomy outlook.

But there are other factors at play that may be eating into fast-food restaurants' business.

The cost of many types of groceries is declining, with the Bureau of Labor Statistics noting that everything from the price of bread to broccoli has declined during the past year. A pound of beef cost about $3.90 in May, a decline of 9.4 percent from a year earlier, for instance.

That's making it more economical for consumers to cook their burgers at home than to dine out.

At the same time, many restaurants are coping with higher labor costs. Some, like McDonald's (MCD) are hiking their baseline wages in response to protests over low pay and growing competition for workers spurred by the nation's low unemployment rate. Others are boosting their hourly rates because some states are mandating higher minimum wages.

Some chains have increased their prices to cope with higher labor costs. Shake Shake (SHAK) boosted prices in January, with menu items rising by less than 1 percent to as much as 6 percent. Pricing pressure may only increase, given the changes to overtime pay regulation that will go into effect in December.

Riggs cautioned that the data represents only a small sliver of time, and that consumers are still making millions of visits to fast-food restaurants each year.

She added, "What we see is a very close relationship between industry traffic and consumer confidence. When consumer confidence slips, the industry seems to follow along with it."