AnyLogic
Expand
Font size

TimeMeasureStart

TimeMeasureStart as well as TimeMeasureEnd compose a pair of blocks measuring the time the agents spend between them, such as "time in system", "length of stay", etc.

This block remembers the time when an agent goes through. Later on when the agent goes through one of the corresponding TimeMeasureEnd blocks, the time the agent spent between these two "marker" blocks is measured.

You must ensure that each agent going through this block later on goes through TimeMeasureEnd block mentioning this one as its pair.

TimeMeasureStart keeps record of all agents that have flown through it and have not yet gone through a paired TimeMeasureEnd. Therefore you should make sure there is no way for such agents to exit the system without going through TimeMeasureEnd, otherwise memory leak will occur.
If you see "The TimeMeasureStart objects must be specified" runtime error, it means that the TimeMeasureEnd block, mentioned in the first line of the error message, has empty TimeMeasureStart blocks property. Specify there the TimeMeasureStart block that starts measuring time in your flowchart.
Demo model: Measuring Length of Stay Open the model page in AnyLogic Cloud. There you can run the model or download it (by clicking Model source files).

Parameters

On enter
Code executed when the agent enters the block.
Local variable: T agent — the agent.

Ports

in
The input port.
out
The output port.
How can we improve this article?