We're having sex about nine fewer times each year than we did in the late 1990s — at least those of use of a certain age. It's worse for married people. They are having sex about 14 fewer times a year.

Apparently, the thrill is gone. Or is it just a lack of opportunity?

The findings come from a survey that has been asking tens of thousands of Americans about their sexual behavior for decades. The results are just in time for the 50th anniversary of the Summer of Love.

No surprise, younger people are leading the way in frequency of sexual contact. “Despite their reputation for hooking up, Millennials and the generation after them (known as iGen or Generation Z) are actually having sex less often than their parents and grandparents did when they were young. That's partially because fewer iGen X'ers and Millennials have steady partners,” said senior study author, Jean Twenge.

If you want to blame the busy lives of working parents, think again. People who worked more hours actually had sex more often.

The study found that more than twice as many Millennials born in the 1990s (15 percent) had had no sexual partners since age 18 compared to GenX’ers born between 1965 and 1980 (6 percent).

Younger people today are still having more sex than older people are. In their 20s people in the study had sex more than 80 times a year. By age 45, that was down to 60 times a year, and at age 65, it dropped to 20 times a year.

One other trend uncovered by the survey is that unmarried people are now having sex more often than married people, a reversal of the status quo that existed through the 1990s.

If you want to blame the busy lives of working parents, think again. People who worked more hours actually had sex more often, said Twenge.

While younger people may be fueling these changes, they're also being seen in older people. To Twenge, it all adds up to an increasingly unhappy society. “Older and married people are having sex less often — especially after 2000,” Twenge, a professor in the department of psychology at San Diego State University, said. “In a previous paper, we found that the happiness of adults over age 30 declined between 2000 and 2014. With less sex and less happiness, it's no wonder that American adults seem deeply dissatisfied these days.”

The study used data collected from the General Social Survey, a nationally representative sample of more than 26,000 American adults asked about their sexual behavior since 1989.

The study appears in the Archives of Sexual Behavior.