A cup of coffee three hours before bedtime may keep you awake, scientists say. A cup of coffee three hours before bedtime may keep you awake, scientists say, BBC reports.