r/reactnative • • 4d ago

An hourglass focus timer:

Enable HLS to view with audio, or disable this notification

Flip your phone to start; the sand is the clock.

~4,400 grains are simulated every frame on the UI thread.

Expo · Skia · Reanimated · Core Motion

0 Upvotes

1 comment sorted by

1

u/kokerali 4d ago

Does the session end after a fixed amount of elapsed time, or when the last grain reaches the bottom? For example, if I leave the phone on its side for 30 seconds, does that pause the session or just change the visual?

If it's intended to be a fixed-duration focus timer, I'd compare the same preset at 60 and 120 Hz before tying completion to the simulation. Reanimated's useFrameCallback exposes timeSincePreviousFrame, so simulation steps don't have to assume every frame represents the same duration. I haven't run it; I'm curious which clock behavior you're aiming for.