I do squats in the bathroom while the shower gets hot (don’t you?) and sometimes, very carefully, in the shower. Some nights, you can find me, headphones in, pajamas on, lifting weights bedside when I’m too tired to change into leggings and head downstairs to my equipment-filled basement. Want to know another one of my exercise habits? My workouts don’t start until 10 p.m. during the work week (I have to fit in HIIT or quick cardio somehow). A lot of conflicting studies exist out there on late-night exercise and its effects on sleep and the body. So, for my own sake — and maybe yours, too — I wanted to get to the bottom of it.

Does Working Out at Night Affect Sleep?

Rebecca Robbins, PhD, sleep researcher at NYU Langone Health, explained to POPSUGAR that there are two different perspectives in her line of work: one discourages nighttime exercise based on evidence that shows that your heart rate goes up because “you’re doing something stimulating” before bed. Janet K. Kennedy, PhD, clinical psychologist and founder of NYC Sleep Doctor, further elaborated, “Approximately two hours before sleep, the body temperature naturally starts to drop. Exercising too late can delay that and also delay the release of melatonin, so it can be harder to fall asleep at bedtime.”

“Then, the other school of thought is based on some interesting evidence that shows there might not be too much detriment to exercising close to bed,” Dr. Robbins said. In fact, studies have found that nighttime workouts have no effect on sleep quality. “Overall, I think we can certainly say with great confidence that exercise is part of a healthy sleep schedule,” Dr. Robbins continued. “Exercise reduces stress because it increases endorphins, which are mood elevators. There are so many benefits, and from a sleep standpoint, people who exercise get better sleep at night.”

When Is the Latest You Can Work Out?

A good rule of thumb, Dr. Kennedy said, is to finish workouts, “especially intense workouts,” at least four hours before bedtime. She continued, “There are some individual differences in how the body cools down after exercise, though, and the best way to determine the minimum amount of cooldown time before bed is to test it.” She recommends working out at different times and keeping a keep a sleep diary to see whether it impacts the time it takes to fall asleep. “On nights when you don’t have enough time for a cooldown, you can still do lower-impact exercise,” she said.

Again, Dr. Robbins explained, it also depends on who you ask. Past experts have told us that you shouldn’t work out after 8 p.m. The National Sleep Foundation advises that you avoid “strenuous workouts in the late evening or right before bed,” though it notes that if nighttime workouts don’t affect your sleep, there’s no need to change your routine.

So, When Is the Best Time of Day to Work Out?

According to John Dale, a board-certified sports physical therapist at Johns Hopkins and Certified Strength and Conditioning Specialist, your coordination, stamina, and lung performance are “best in the evening, and that’s also when your flexibility, pain tolerance, and strength are at their greatest.” So, he advised, you might want to strength-train then. When asked what time of day our muscles respond best to working out, though, he said late afternoon or early evening because “your pain tolerance is at its highest, and your perceived exertion is at its lowest. You might be able to have a little harder workout, which might lead to better strength gains or cardio improvement depending on what you’re looking for.”

From a sleep perspective, Dr. Robbins said, “I think the optimal time for exercise, just to reap the benefits of those endorphins releasing, would probably be in the early afternoon. And, if you notice that working out later in the day keeps you from falling asleep, “you might not run the risk of increasing your heart rate too much” if you hit the gym between 4 and 7 p.m. That’s not to say that morning workouts are bad. In fact, Dr. Dale noted that, in the morning, “testosterone is shown to be at higher levels, and you’re most mentally alert.” Both he and Dr. Robbins ultimately want you to know that it really does boil down to listening to your body.

Pro Tip: See What Works For You

According to Dr. Kennedy’s four-hours-before-bed rule, I should be starting my workout at 7 p.m. the latest (given that I exercise for about an hour and my bedtime is usually midnight). Unfortunately, that isn’t realistic for me and my schedule during the work week, but the general consensus from these experts is that figuring out what you respond best to is essential. If you’re motivated at night, then “follow your rhythm,” as Dr. Robbins said. Dr. Dale pointed out that some people, himself included, like morning workouts simply because it’s the only time of day they know they’ll get it done.

When asked what she thought about my 10 p.m. workouts specifically, Dr. Robbins said, “If that’s the only time you’re able to exercise, I’d say do it, especially if you’re doing something that’s maybe low impact.” She did suggest, however, taking advantage of workouts on the weekends more. Dr. Dale told me the most important thing is consistency: “I would much rather have someone say, ‘I can be more consistent with going to work out at 10 at night than I can at six in the morning.'” He also emphasized the importance of recovery and advises against working out late at night and waking up early the next day to exercise again. So, will I be adjusting my routine? I’m thinking about it, but when it comes to listening to your body, you don’t have to tell me twice.