index.tsx87 chars6 lines
The function delayedFunction
uses setTimeout
to wait for 3 seconds before calling itself recursively.
Note: This implementation will not be accurate to exactly 3 seconds as it has a delay inherent to the event loop. If precise timing is required, setInterval
may be a better option.
gistlibby LogSnag