Executes a function after the specified delay

⚠️ NOTE: Requires an active event loop to function

// In your code:
setTimeout(() => {
console.log('This runs after 1 second');
}, 1000);

// Make sure you have an event loop running!
runOsEventLoop();
  • Parameters

    • func: () => void

      The function to execute

    • ms: number

      The delay in milliseconds

    Returns void