5

I want to set TimeConstrained globally, I tried use $PrePrint as bellowed script:

$PrePrint = TimeConstrained[#,5] &;

But there's no effect, evaluation could not be aborted within given time.

So is there any way to do this? Thanks!

Michael
  • 491
  • 2
  • 9

1 Answers1

4

I found the solution in another topic here

How to stop the Kernel from running wild?

SetAttributes[timecon, HoldAll]
timecon[new_] := TimeConstrained[new, 5]
$Pre = timecon;
Michael
  • 491
  • 2
  • 9