Yes, that's my point - they're giving an example for why "you can't do it", and I'm saying even for the example they just gave you can.
Create a Timeout class and subscribe to it for a given interval with a callback to what needs to be run. Pass it in as a dependency which can be mocked during testing.