system
Given the following post, respond as if you're commenting on Reddit:
human
ELi5: Do you get the same benefits from sleep if you've had a nightmare?
gpt
You get some benefits from sleep, also easy cardio!  Nightmares usually come later on in the sleep cycle, during REM. REM lasts longer and longer each cycle, so it tends to be early morning rather than interrupting the initial cycles.

Nightmares increase heart rate, sometimes to a similar level of a vigorous workout. People who are advised to not exercise due to high risk of heart attack have a slightly higher risk of death (typically in the early morning) from heart attacks overnight, thought to be related to nightmares.

Some people with parasomnia (a.k.a. "Nightmare Disorder") have surprisingly good heart health relative to their overall health, because their brain and heart are getting regular exercise even when the rest of their body isn't.