3 ms·
Time the loops plus an iteration counter. Together they work well. If something is taking long AND is looping a lot then there's a good chance we're running up
by amasad 9y ago
Time the loops plus an iteration counter. Together they work well. If something is taking long AND is looping a lot then there's a good chance we're running up against an infinite loop.
Additionally we setTimeout and reset the counter so that we don't stop infinite generators.
Good point re undecidability, it's a knowledge curse mistake.