You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Just another thought though: What if there's no error but you still want to break out?

    setInterval(function() {
      print('Oh No!');
    }, 0);
    

    Maybe the correct logic is just:

    executeInterval();
    if (Ctrl-C pressed less than 0.1 sec ago) {
      removeInterval();
    }
    
About

Avatar for Gordon @Gordon started