Exercising at night can improve your sleep under the right conditions, according to a new study published in the journal Sleep Medicine Reviews. Researchers compiled data from 15 different sleep studies to see how exercise before bedtime affected healthy adults. They found that when exercise ended two hours before bedtime, people were able to fall asleep more easily and sleep longer. This finding especially applied to normally sedentary people. But if the exercise finished less than two hours before bedtime, participants took longer to fall asleep, and their sleep duration decreased. But before you switch your workout time, pay attention to whether you’re naturally more of a morning or evening person. People who are more morning larks struggled with sleep after evening exercise. And if you switch to nighttime exercise, take a shower and avoid a heavy meal before you go to bed.