CAEngine::DefaultEvaluationTimeLimit

Revision as of 01:43, 20 October 2015 by Jhuawen (talk | contribs) (Created page with "= 另请参考 =")

ADE User Guide > ADE Server Class Reference > CAEngine

ADE 4.3新特征

描述

The maximum time limit in milliseconds imposed on evaluations from methods in CAEngine, i.e., SendCommand, Send, OpenModel, and AddModule, as well as the default value for CAObject::MethodEvaluationTimeLimit for any CAObjects instantiated. A value of zero indicates no time limit.

Data Type

long

访问

读 / 写

示例用法

CAEngine ade = new CAEngine;
ade.DefaultEvaluationTimeLimit = 10000 /*ms*/;    // abort any computation that takes more than 10 seconds

什么时候使用

Use this if you are worried about a computation (perhaps in an arbitrary model) taking an excessively long time and thus hogging CPU cycles.

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.

另请参考

Comments
Loading comments...