Calculate Elapsed Time

When you want to calculate how long an entity spent between two points in your model. By capturing the elapsed time to a variable, you can plot the results in a Time Series plot (as shown after simulating this model object).

Calculate Elapsed Time model image

Where to Find the Model Object

The following model object can be found in the model objects directory:

  • Reporting \ Calculate Elapsed Time

Difficulty Level

  • Ease of Use: Easy
  • Ease of Modification: Easy

How to Use the Model Object

  1. Open Your Model: Open your model or create a new blank model.
  2. Insert the Model Object into Your Model
    1. Locate the model object Calculate Elapsed Time and select the insert button.
    2. Move the cursor to the point of insertion and left mouse-click. The upper left corner of the model object will be inserted at the location of the mouse-click.
  3. Connect to Your Model: You should see two percentage route routes copied to your model a route to the left and a route to the right.routes pasted in Calculate Elapsed Time
    1. Connect the arrival part of the percentage route on the left to the part of your model where you would like to start collecting time information / start tracking time.track start left Calculate Elapsed Time
      1. Connect the exit part of the percentage route on the left to the rest of your model.track start right Calculate Elapsed Time
    2. Connect the arrival part of the percentage route on the right to the part of your model where you would like to stop collecting time information / stop tracking time.track end left Calculate Elapsed Time
      1. Connect the exit part of the percentage route on the right to the rest of your model.track end right Calculate Elapsed Time The location of the action logic used in this model object can be moved to any location you like. For example, you could assign the start time in an activity and calculate the elapsed time in another activity. Just be aware that in this case, the start time will begin “after” the entity has left the input queue of the first activity. Therefore, any waiting time in the input queue will not be included in the elapsed time.

        If you calculate the elapsed time in an activity rather than on the route leaving it, make sure you use a TIME statement in that activity’s action tab because any time assigned on the General tab for that activity will occur “after” the action logic has been executed. Also be aware that, in this case, the calculation will occur “before” entering the activity’s output queue (if you have one assigned).

  4. Review Output Report
    1. Simulate the model.simulate model in Calculate Elapsed Time
    2. Open the Output Report for information on v_Elapsed_Time1 variable.output report in Calculate Elapsed Time
    3. Export the variable data by clicking the second Excel icon that will Export Variable Report to Excel.