IAlgorithmTimeResult.ExecuteMilisecods

Syntax

ExecuteMilisecods: Integer;

None;

Description

The ExecuteMilisecods property returns object calculation execution time.

Example

Executing the example requires that the repository contains a ready calculation algorithm with the ALGORITHM identifier. The calculation algorithm should contains configured objects.

Add a link to the Calculation Algorithm Core custom assembly contained in the Calculation Algorithms component, and links to the Algo, Metabase system assemblies.

Sub UserProc;
Var
    
MB: IMetabase;
    MObj: IMetabaseObjectDescriptor;
    Algo: ICalcObject;
    CalcAlgo: ICalcAlgorithm;
    CalcResult: IAlgorithmCalculationResult;
    CalcObj: IAlgorithmTimeResults;
    Obj: IAlgorithmTimeResult;
    i: Integer;
    Sec: Double;
Begin
    MB := MetabaseClass.Active;
    
// Get calculation algorithm
    MObj := MB.ItemById("ALGORITHM");
    Algo := CalcObjectFactory.CreateCalcObject(MObj, 
True);
    CalcAlgo := Algo 
As ICalcAlgorithm;
    
// Calculate algorithm
    CalcResult := CalcAlgo.Calculate;
    
// Get objects calculation result
    CalcObj := CalcResult.Calc;
    
For i := 0 To CalcObj.Count-1 Do
        Obj := CalcObj.Item(i);
        Debug.WriteLine(
"Name: " + Obj.Name);
        Debug.WriteLine(
"Identifier: " + Obj.Id);
        Debug.WriteLine(
"Key: " + Obj.Key.ToString);
        Sec := Obj.ExecuteMilisecods/
1000;
        Debug.WriteLine(
"Calculation time: " + Sec.ToString + " sec");
        Debug.WriteLine(
"");
    
End For;
End Sub UserProc;

Not provisioned.

After executing the example, calculation algorithm objects are calculated. The console displays the calculation result, for example:

Name: Calculation block

Identifier: CALC

Key: 230593

Calculation time: 0.057 sec

 

Name: Control block

Identifier: CONTROL

Key: 230831

Calculation time: 0.018 sec

See also:

IAlgorithmTimeResult