Routine to get Elapsed time of Simulation

Dear colleagues,

is there any way of getting the elapsed simulation time inside a robot program? The goal is to count each box to be palletized and at the end, given a certain condition, get the elapsed time to generate statistical measures.

I know the existence of the Elapsed variable inside ISimulation Interface.

double Elapsed { get; }

However, I could not use it inside the robot routine.

Any clarifications on how to perform this task will be very appreciated. Thank you in advance for any attention to this matter!

André Castro.