수면 주기 계산기
90분 수면 주기를 기반으로 최적의 취침 시간 또는 기상 시간을 찾아드립니다.
수면 주기 계산기는 신체의 자연스러운 90분 수면 주기에 맞춰 취침 시간이나 기상 시간을 계획하는 데 도움을 줍니다. 수면 중 뇌는 얕은 수면, 깊은 서파 수면, REM(꿈) 수면을 포함한 단계를 순환합니다. 하나의 완전한 주기는 약 90분이며, 깊은 수면 중간이 아닌 주기의 끝에 일어나면 졸리지 않고 쉰 느낌으로 깨어납니다.
기상하고 싶은 시간 또는 잠들 계획인 시간을 입력합니다. 도구가 완전한 수면 주기의 끝에 해당하는 취침 시간 또는 기상 시간을 계산하며, 잠드는 데 평균 15분이 걸리는 것을 고려합니다. 4, 5, 6, 7, 8 주기에 대한 결과가 표시되어 약 6~12시간의 수면을 아우릅니다.
대부분의 성인은 7-9시간의 수면, 즉 5-6개의 완전한 주기가 필요합니다. 권장 시간 수면에도 불구하고 정기적으로 피곤하게 일어난다면 타이밍 문제일 수 있습니다 — 깊은 수면 단계 중간에 깨고 있는 것입니다. 취침 시간을 20-30분 조정하면 눈에 띄는 차이를 만들 수 있습니다.
자주 묻는 질문
코드 구현
from datetime import datetime, timedelta
CYCLE_MINUTES = 90 # average sleep cycle length
SLEEP_LATENCY_MINUTES = 15 # average time to fall asleep
def wake_times(bedtime_str, num_cycles=6, latency_minutes=SLEEP_LATENCY_MINUTES):
"""
Given a bedtime string ("HH:MM"), return suggested wake times
for 3 to num_cycles complete sleep cycles.
"""
bedtime = datetime.strptime(bedtime_str, "%H:%M")
results = []
for cycles in range(3, num_cycles + 1):
sleep_duration = timedelta(
minutes=latency_minutes + cycles * CYCLE_MINUTES
)
wake = bedtime + sleep_duration
results.append({
"cycles": cycles,
"sleep_hours": round((cycles * CYCLE_MINUTES) / 60, 1),
"wake_time": wake.strftime("%H:%M"),
})
return results
def bedtime_for_wake(wake_time_str, num_cycles=6, latency_minutes=SLEEP_LATENCY_MINUTES):
"""
Given a target wake time, suggest when to go to bed for
3 to num_cycles complete sleep cycles.
"""
wake = datetime.strptime(wake_time_str, "%H:%M")
results = []
for cycles in range(3, num_cycles + 1):
sleep_duration = timedelta(
minutes=latency_minutes + cycles * CYCLE_MINUTES
)
bedtime = wake - sleep_duration
results.append({
"cycles": cycles,
"sleep_hours": round((cycles * CYCLE_MINUTES) / 60, 1),
"bedtime": bedtime.strftime("%H:%M"),
})
return results
# Example 1: bedtime → wake times
print("If you go to bed at 23:00, wake up at:")
for w in wake_times("23:00"):
print(f" {w['cycles']} cycles ({w['sleep_hours']}h) → wake at {w['wake_time']}")
# Example 2: target wake time → bedtimes
print("\nTo wake up at 07:00, go to bed at:")
for b in bedtime_for_wake("07:00"):
print(f" {b['cycles']} cycles ({b['sleep_hours']}h) → bed at {b['bedtime']}")Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.