Comment

Comment by onox

In Ada you can do something similar:

    delay 0.3;
Or with package Ada.Real_Time:

    delay To_Duration (Milliseconds (300));
Or use `delay until`:

    delay until Clock + Milliseconds (300);
`delay until` is useful in loops because `delay` sleeps at least the given duration, so you get drift. (You call Clock only once and store it in a variable before the loop and then update it adding the time span each iteration)
parent onox 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton