Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void observeInstructionCount(Context cx, int instructionCount)
- {
- MyContext mcx = (MyContext)cx;
- long currentTime = System.currentTimeMillis();
- if (currentTime - mcx.startTime > 10*1000) {
- // More then 10 seconds from Context creation time:
- // it is time to stop the script.
- // Throw Error instance to ensure that script will never
- // get control back through catch or finally.
- throw new Error();
- }
- }
Add Comment
Please, Sign In to add comment