Skip to content

Comment on The Colour Clockparent

Comments

Rather useful in this case could be an adaptive method. First, you update every 50ms until you circled in the moment when the second toggles. Then you can do sleep(1) again and save resources.

Alternatively, use time() to only sleep the remaining timespan until the next second.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.