question

Kevin A2 avatar image
0 Likes"
Kevin A2 asked Shawn Murty answered

How can I extract the time passed of a processor undergoing a process?

For example, there is a processor with a process time of 90 seconds. When there is a item comes to the processor and the processor starts working, how can I know how many seconds has passed since the processor starts working? Thanks.

FlexSim 17.2.5
processor
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Phil BoBo avatar image
2 Likes"
Phil BoBo answered Kevin A2 commented

getitemvar(item, 1) returns the time when an item started processing in a processor. The following code snippet will return the amount of time an item has spent processing if it is in a processor:

treenode item = model().find("Processor1").first;
return time() - getitemvar(item, 1);
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Kevin A2 avatar image Kevin A2 commented ·

Thank you.

0 Likes 0 ·
Shawn Murty avatar image
0 Likes"
Shawn Murty answered

getitemvar(item, 2)
This gives you the actual process time used instead of the solution "current time" - "time of the flow item entering the processor". The code above will work even if there are breaks in process time (process down time or operator scheduling issues).
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.