Happiness is found by living in the now, particularly if the now involves having sex, according to a major study into mental wellbeing.
But the study also found that people spend nearly half their time (46.7%) thinking about something other than what they are actually doing.
The benefits of living in the moment are extolled by many philosophical and religious traditions, but until now there has been scant scientific evidence to support the advice.
Psychologists at Harvard University collected information on the daily activities, thoughts and feelings of 2,250 volunteers to find out how often they were focused on what they were doing, and what made them most happy.
They found that people were happiest when having sex, exercising or in conversation, and least happy when working, resting or using a home computer. And although subjects' minds were wandering nearly half of the time, this consistently made them less happy.
The team conclude that reminiscing, thinking ahead or daydreaming tends to make people more miserable, even when they are thinking about something pleasant.
Even the most engaging tasks failed to hold people's full attention. Volunteers admitted to thinking about something else at least 30% of the time while performing these tasks, except when they were having sex, when people typically had their mind on the job around 90% of the time.
"Human beings have this unique ability to focus on things that aren't happening right now. That allows them to reflect on the past and learn from it; it allows them to anticipate and plan for the future; and it allows them to imagine things that might never occur," said Matthew Killingsworth, a doctoral student in psychology and lead author of the study.
"At the same time, it seems that human beings often use this ability in ways that are not productive and furthermore can be destructive to our happiness," he added.
For the study, Killingsworth and his supervisor, Daniel Gilbert, author of the 2006 book Stumbling on Happiness, developed a web application for the iPhone that contacted participants at random times during their waking hours. When they received a message, those taking part had to respond with information about what they were doing, by selecting from a list of 22 activities, such as doing housework, shopping, or watching TV. They went on to rate their happiness on a scale from zero to 100, and said whether they were focused, or daydreaming about something positive, negative or neutral.
The results showed that happiness was more affected by how often people drifted off, and where they went in their imagination, than by the activity they were doing at the time. The researchers say they're confident that being distracted was the cause of unhappiness, rather than the other way round.
The authors write in the journal Science: "A human mind is a wandering mind and a wandering mind is an unhappy mind. The ability to think about what is not happening is a cognitive achievement that comes at an emotional cost."
Asked why people seemed to be particularly focused during sex, Killingsworth observed: "If you were messaged while you were having sex it probably wouldn't turn out so well if you whipped out your iPhone. Sex is one of the few broad categories of activity that requires and perhaps benefits from our full attention."
More than 5,000 people have signed up for the happiness study and the researchers hope to attract more so they can look at mental wellbeing in different geographical regions and between the sexes with greater accuracy.
"Hopefully we will get a lot of new participants from all over the world and be able to answer questions we've not really been able to ask before, because we've never had this kind of data on people's experiences," Killingsworth said.
Take part in the study at www.trackyourhappiness.org