As time of execution of the process function may be too long, update function may break the entire process using terminate class.

How should I exit process() (checking if(break.break()) inside it) keeping best performance possible ? Meaning throwing exception is probably not the best option. Doing many if checks inside the process() is not good either. So what do you think ?

Any other solutions to this problem that do not use separate termination class to break a function call are appreciated.