If you want to nod off easily you know that chugging the caffeine pre-bed time is a massive faux-pas.
The study, by researchers at Florida Atlantic University and Harvard Medical School and published in the journal Sleep, used sensors and daily sleep diaries to track the sleep of 785 participants across 5,164 days and nights.
As well as recording the hours of sleep each person clocked up, they also analysed the quality of their sleep, plus how much alcohol, caffeine, or nicotine they consumed within four hours before going to bed.
The study found that while nicotine and alcohol disrupted sleep, caffeine seemed to have no effect.
While a nightcap might seem like a good idea to help you drift off, in fact sleep was more disrupted after drinking alcohol or smoking, which made for lower quality rest and feeling groggy in the morning.
Smoking was the substance most strongly associated with sleep disruption, with nightly nicotine use linked to an average 42-minute reduction in sleep duration.
But researchers found that consuming caffeine within four hours of bedtime had no impact on sleep.
Writing in the journal Sleep Dr Christine Spadola, of Florida Atlantic University, University, said that despite the health importance of sleeping well, up until now relatively few studies have thoroughly investigated the association between evening substance use and sleep parameters.
"This study represents one of the largest longitudinal examinations of the associations of evening use of alcohol, caffeine and nicotine with objectively measured sleep outcomes,” she wrote.
"A night with use of nicotine and/or alcohol within four hours of bedtime demonstrated worse sleep continuity than a night without.
"We did not observe an association between ingestion of caffeine within four hours of bed with any of the sleep parameters."
"This was a surprise to us but is not unprecedented. The previous evidence is mixed when it comes to the effect of caffeine on sleep," Dr Spadola added.
Before you stick the kettle on for a pre-bed cuppa, it’s worth noting that the study authors do warn that dosing, sensitivity, and tolerance weren’t measured and “can play an important role in the association between caffeine use and sleep.”
In other words you could be more sensitive to the effects of caffeine than others, which means just one little latte before bed could actually have a big impact on your sleep disruption.
The NHS recommends cutting down on tea, coffee, energy drinks or cola before bed as caffeine is thought to interfere with the process of falling asleep.
The authors went on to say that the findings "support the importance of sleep health recommendations which promote the restriction of evening nicotine and alcohol".
So while that coffee you had at 5pm to get you through the last hours of work might not be stopping you sleeping, if you’re finding yourself tossing and turning at night it could be worth ditching the wine and the ciggies to help up your ZZZ quota.