Skip to content

Main content

Sleep Log Nap Overlap Duration

Intersect explicit half-open sleep and nap intervals on one continuous minute timeline without detecting sleep.

Loading tool…

Description

Measure the overlap between a sleep interval and a recorded nap interval.

Personal health logs distinguish observed events, unknown entries, device/source identifiers and chosen day or streak boundaries. A numerical activity duration or recorded symptom label organizes supplied data rather than diagnosing a condition. Fixed 86400-second days differ from civil days affected by timezone and daylight-saving changes.

Measure the overlap between a sleep interval and a recorded nap interval.

When to use this tool

Use Sleep Log Nap Overlap Duration when checking the stated personal-log, missingness, time or streak convention.

How to use the tool and how it works

  1. Enter sleepStartMinutes, sleepEndMinutes, napStartMinutes, napEndMinutes. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read overlapMinutes. Use the output convention below.

Require each supplied sleep/nap end>=its start. Return max(0,min(ends)-max(starts)) in minutes.1

Input fieldMeaning and unitsAccepted input
sleepStartMinutesSleep Start MinutesRequired. Finite number.
sleepEndMinutesSleep End MinutesRequired. Finite number.
napStartMinutesNap Start MinutesRequired. Finite number.
napEndMinutesNap End MinutesRequired. Finite number.
Output fieldInterpretationReturned shape
overlapMinutesOverlap MinutesRequired. Finite number.
json
{
  "input": {
    "sleepStartMinutes": 100,
    "sleepEndMinutes": 200,
    "napStartMinutes": 180,
    "napEndMinutes": 220
  },
  "output": {
    "overlapMinutes": 20
  }
}

Limitations and assumptions

  • Clock rollover must already be represented in the coordinates; sleep quality, actual events and clinical significance are not inferred.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Review original records and calibrated devices; consult qualified health professionals for symptoms, interpretation or actual care decisions.

References

  1. Calculation and input contract: health/sleep-log-nap-overlap-duration — tool.io

Similar or alternative tools