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!
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!
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;
$Preand related items. – bbgodfrey Aug 31 '15 at 04:00