The 90-minute cycle
Sleep is organized into cycles of about 90 minutes each: light sleep → deep sleep → REM → back to light. Waking up between cycles (during light sleep) leaves you refreshed; waking mid-deep-sleep causes that groggy "sleep inertia" that lingers for hours.
How to use this
- Fixed wake time? Count back 90-minute cycles (aim for 5–6 → 7.5–9 hours) and go to bed at one of those times. Include ~14 minutes to fall asleep.
- Sleeping now? Set your alarm for a multiple of 90 minutes from now plus about 15 minutes to fall asleep — 6 cycles (9h) or 5 cycles (7.5h) are the sweet spots.
- Consistency beats perfection: same bedtime and wake time daily anchors your circadian rhythm better than any cycle math.
Caveats
Cycles vary from person to person (80–110 min) and change across the night (later cycles have more REM). This is a helpful planning heuristic, not a precision instrument — combine it with how you actually feel.
How the estimate is derived
Sleep is modelled as repeating cycles of roughly ninety minutes. calc() either projects forward from a bedtime to suggest wake-up times that land at a cycle boundary, or works backwards from a fixed wake-up time to suggest bedtimes. addMin() handles the minute arithmetic, fmtTime() formats the output, and setMode() flips direction while keeping the values you entered.
When not to rely on it
Ninety minutes is an average, not a constant: individual cycles run from seventy to a hundred and twenty minutes and shift with age, alcohol and accumulated sleep loss. Falling asleep is not instant — most people need ten to twenty minutes, which the calculation does not add. Cycle count says nothing about sleep quality, and shift work or jet lag makes the whole model unreliable.
Privacy: health data never leaves your device
Bedtimes are used for one calculation and then forgotten. There is no account and no storage, so your schedule is not recorded.
Frequently asked questions
Why ninety minutes?
Because it is the common adult average. Track your own for a few weeks if you want a better figure — the difference matters.
Should I add time to fall asleep?
Yes. If you get into bed at 23:00 you probably fall asleep nearer 23:15, so set the bedtime earlier than the target.
Is waking at a cycle boundary enough?
It reduces grogginess. Total sleep, continuity and depth matter more than which minute the alarm fires.