Infinite loop

Good evening,

I can’t find any documentation on a built in functionality to halt infinite loops, am I missing it?

Essentially I need to stop the execution of a piece of code in the case this exeedes a set amount of time, but in reality any other built in way will also work perfectly.

CodeMirror doesn’t run code, it just lets you edit it, so it also has no functionality for this kind of thing.