Calculate interval

Find how many complete fixed intervals fit inside a duration and their ideal frequency.

freeworks offlinenothing uploaded
ToolInterval Calculator
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

Duration is converted to milliseconds and divided by the requested interval length. Complete repetitions use floor division, while events per second are the reciprocal of interval milliseconds.

  • A trailing partial interval does not count.
  • Execution delay, scheduling jitter, and browser throttling are not modelled.

Worked example

API Polling Interval
Calculate how many times a 500ms polling interval fires per hour
Input
											Interval ms: 500
Duration: 3600
										
Output
												=== Interval Calculator ===

Interval: 500ms
Duration: 3600s

Results:
  Executions: 7200
  Frequency: 2.0000 Hz

Conversions:
  Per second: 2.00
  Per minute: 120.00
  Per hour: 7200.00
  Per day: 172800

Interval as:
  Milliseconds: 500
  Seconds: 0.500
  Minutes: 0.0083
											

When to use this

Polling plans estimate complete requests in a test window, sensor settings translate sample intervals into hertz, and animation loops estimate ideal ticks.

Edge cases

  • A 10-second window with a 3-second interval contains three complete intervals, not 3.33 events.
  • An interval longer than the duration gives zero complete repetitions.
  • A one-millisecond interval reports 1,000 ideal events per second even though browsers may throttle timers.