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.export variable data in Calculate Elapsed Time
      1. Choose the location where you would like the Excel file to be saved.
      2. Choose the variables you would like to export and click OK. Goto the location chosen at step 4.3.1 and open the  Excel file.export variable data dialog in Calculate Elapsed TimeThe reason for using Output Report for exporting variable data is that ir can export more than one million rows of data (Excel limitation), while Output Detailed Report can only export upto 16,382 rows.
    4. Open the Output Detailed Report, click the Generate a time series plot icon, add v_Elapsed_Time1 to Selected Values and then click OK.time series plot in Calculate Elapsed Time
  5. Completion: The model object is now integrated into your model, you should now be able to save and then simulate the model.

Controls Usage

Attributes:

  1. a_Start: Do not change.Simulation clock time when the entity enters the Process activity.

Variables:

  1. v_Elapsed_Time1: Do not change. The difference between the current simulation clock time and the start time.
Was this article helpful?

Related Articles

Go to Top