CAEngine::DefaultEvaluationTimeLimit
ADE User Guide > ADE Server Class Reference > CAEngine
描述
强加在CAEngine中方法计算上的最大时间限制(单位:毫秒),这些方法包括:SendCommand、Send、OpenModel,和AddModule,以及任何实例化的CAObject的 CAObject::MethodEvaluationTimeLimit默认值,
数据类型
long
访问
读 / 写
示例用法
CAEngine ade = new CAEngine; ade.DefaultEvaluationTimeLimit = 10000 /*ms*/; // 终止计算时间超过10秒的任何计算。
什么时候使用
如果你担心计算(可能在任意模型当中)会花非常长的时间并因此导致大量占据CPU周期你可以使用此方法。
For computation of variable results, you have the option of setting CAObject::MethodEvaluationTimeLimit instead. However, if you want to limit the time spent when a typescript command is evaluated (e.g., via CAEngine::SendCommand), or for evaluations that occur when opening a model, then you must set the time limit using this property.
An alternative to limiting the maximum evaluation time is to provide your users with an "abort" functionality, such as Ctrl+Break. See How to Abort an ADE Computation.
Enable comment auto-refresher