Drinking coffee or tea just before bed does not affect the quality of sleep, a new study has found.

US researchers from Harvard Medical School monitored 785 people for a total of 5,164 days and nights, recording how much caffeine, alcohol and nicotine they consumed.

However, alcohol and nicotine consumed in the 4 hours leading up to bedtime have a negative effect on your sleep. With nicotine reducing sleep duration on average by 42 minutes.

Earlier this year, a separate study suggested that drinking as little as two cups of coffee a day could increase life expectancy by up to two years.