Two seconds, then kill it with fire!

In this example I'm setting a time limit for code execution. If the execution takes too long, the TimeoutException is beeing raised and we can proceed with the rest of the program.