A new study suggests that using an electronic device like a smartphone, ipad or laptop for a significant amount of time (2 hours or more) just before bedtime can reduce your levels of the hormone, melatonin, by as much as 25% and negatively impact your sleep cycle. Over time, the accumulated disruption of sleep can raise your risk of breast cancer and obesity. Immediately, its impact can also be felt in poor mental and physical performance the next day and cumulatively.
So close all electronics within two hours of bedtime. That may be tough for most people, so try limiting your electronic device time slowly and build up to wrapping up two hours before bedtime.