User Rating 0.0
Total Usage 0 times
0:00
1:00
Is this tool helpful?

Your feedback helps us improve.

About

An hourglass measures time through granular flow - sand grains falling under gravity through a constricted neck between two glass bulbs. The flow rate depends on the neck diameter, grain size, and bulk density of the sand, approximated by the Beverloo equation where discharge rate W scales with do5/2 (orifice diameter raised to the 2.5 power). Real hourglasses drift 1 - 3% per cycle due to humidity and grain fracture. This tool renders a physically-plausible particle simulation on Canvas at 60fps, conserving total sand volume between bulbs. Duration accuracy is governed by requestAnimationFrame timestamps, not frame counting, so it remains precise regardless of display refresh rate.

Limitations: the simulation uses simplified 2D collision geometry rather than DEM (Discrete Element Method) granular dynamics. Particle-to-particle friction and rotational inertia are omitted. The visual result is convincing but not a calibrated physical model. Pro tip: for presentation timers, pick a duration slightly shorter than your slot - audiences notice overruns more than early finishes.

hourglass timer sand animation canvas countdown visual timer hourglass simulator

Formulas

The Beverloo equation models granular discharge rate through an orifice:

W = C ρb g (do k dp)5/2

Where W = mass flow rate kg/s, C0.58 (empirical constant), ρb = bulk density kg/m3, g = gravitational acceleration 9.81 m/s2, do = orifice diameter m, dp = particle diameter m, and k1.4 (shape factor).

In this simulation, the remaining sand fraction at time t is computed as:

f(t) = 1 tT

Where T = total configured duration s. The particle emitter rate is proportional to NT particles per second, where N = total grain count. Each particle undergoes vertical acceleration ay = g (scaled to pixel space) with position updated via Euler integration: yn+1 = yn + vy Δt + 0.5 g Δt2.

Reference Data

Historical HourglassEraDurationNeck DiameterSand TypeUse Case
Marine Watch Glass14th century30 min2 - 3 mmMarble dustNaval watch shifts
Church Sermon Timer15th century60 min3 mmCrushed eggshellLimiting sermon length
Cooking Glass18th century3 min1.5 mmFine silicaEgg boiling
Pharmacist's Glass17th century1 min1 mmIron filingsTimed preparations
Parliament Timer16th century15 min2 mmBlack marble dustDebate time limits
Navigation Ampolleta1500s30 min2.5 mmGround feldsparDead reckoning at sea
Industrial Process Timer19th century5 min2 mmTin oxide powderFactory process timing
Board Game Timer20th century1 - 3 min1.5 mmDyed silicaChess & parlor games
Sauna TimerModern15 min3 mmColored glass beadsSauna session length
Toothbrush TimerModern2 min1 mmPlastic micro-beadsDental hygiene
Tea Steeping GlassModern3 - 5 min1.5 mmStainless steel shotBrewing precision
Meditation TimerModern10 - 30 min2 mmColored sandMindfulness sessions

Frequently Asked Questions

In a well-designed hourglass, the Beverloo equation shows that flow rate depends on orifice geometry and grain properties - not on the head height of sand above. This is a counterintuitive but experimentally verified property of granular flow (unlike Newtonian fluids). The simulation mirrors this: particle emission rate remains constant throughout the cycle, matching real hourglass behavior.
The animation uses performance.now() timestamps from requestAnimationFrame rather than counting frames. This makes it independent of display refresh rate (60 Hz, 120 Hz, or variable). Drift is typically under 16 ms per cycle. For timing-critical applications, the displayed countdown text is authoritative; the particle animation is cosmetic.
Browsers throttle requestAnimationFrame to ~1 fps or pause it entirely in background tabs. The timer compensates by computing elapsed time from wall-clock deltas on each frame, not accumulating fixed increments. When the tab regains focus, the sand state jumps to the correct position. No time is lost.
Yes. The particle emitter rate scales inversely with duration. At 60 minutes, fewer particles are emitted per second, reducing CPU load. Total active particles are capped at 500 to prevent performance degradation. The visual density of the sand pile is maintained by drawing settled grains as a static height-map rather than tracking individual resting particles.
When the user's operating system has prefers-reduced-motion: reduce enabled, the animated particles are replaced with a simple linear progress bar showing the remaining fraction. The hourglass outline is still drawn statically for visual context, but no moving elements are rendered. The timer countdown remains fully functional.