Mathematica 9 is now available

TimeConstrained

Usage

TimeConstrained[expr, t] 计算expr,在t 秒后结束。
• 如果没有达到时间限制,TimeConstrained[expr, t, failexpr] 返回failexpr


Notes

• 如果计算在指定的时间里没有完成,TimeConstrained 产生一个中断中止expr的计算。
• 仅在计算中止时,TimeConstrained 计算 failexpr
• 如果计算中止且没有指定任何 failexprTimeConstrained 返回 $Aborted
• 仅在向下达到至少 $TimeUnit 秒的间隔时,TimeConstrained是准确的。
• 由TimeConstrained产生的终止象由Abort产生的一样处理,它可以由AbortProtect覆盖。
• 参见Mathematica 全书: 2.13.3.
Further Examples

TimeConstrained returns $Aborted if it cannot perform this evaluation within  seconds.

In[1]:=  

Out[1]=

See the Further Examples for Timing.



Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.