How to Draw a Timing Diagram in UML?

The UML timing diagrams focus on the specific timing in which the messages are sent from one object to another and on the specific timing in which objects change their state. Timing diagrams are common when dealing with real time systems.

Steps to develop a Timing Diagram

The steps below outline the major steps to take in creating a UML Timing Diagram.

  1. Stack several life lines of different objects in the same timing diagram.
  2. Put one life line with a number of possible states above the other vertically, and the passage of time (say in seconds) horizontally.
  3. Each object has a set of possible states. The state will be changed over time indicated by the timeline.
  4. Model the messages sent from one object to another can be depicted using simple arrows.
  5. Remind that the start and the end points of each arrow indicate when each message was sent and when it was received.

Timing Diagram at a glance

Developing a Timing Diagram

  1. Click Diagram > New from the toolbar.
    Create new diagram
  2. In the New Diagram window, choose Timing Diagram, then Click Next. You can use the search bar to find the diagram.
    Select Timing Diagram
  3. Name the diagram then click OK. We will name the diagram Select Timing Diagram in this tutorial.
    naming time diagram
  4. You will then see an empty diagram
  5. Select Timing Frame, then click or drag on the diagram to create a timing frame.
    Create Timing Frame
  6. Double click the word Frame on the timing frame to rename the frame.
  7. Right click the frame and select Add Lifeline to create a lifeline.
    rename time frame and add lifeline
  8. Double click Lifeline and rename the lifeline to Inspector. Right click Inspector and select Add State/ Condition to create a new state or condition.
  9. Double click State/Condition and rename the state or condition. In this tutorial, we will be renaming this state to Idle.
  10. Repeat step 7 to 9 for creating more lifelines and state or conditions.
  11. You should see a diagram like this after adding lifelines and states:
    halfway Finished timing diagram
  12. Right click on any empty space in the timing frame, and click Add Time Unit. We will then see a tiny vertical line (the time unit) appear at the bottom of the frame.
    add time unit
  13. Double click the time unit to add a caption.
  14. Repeat step 12 and 13 for more time units. Except the leftmost time unit, you can drag and relocate all time units. When you are adding more time units, you can see a line appears on every lifeline.
    A line bring generated while creating time units
  15. When you move your cursor near the line mentioned on step 13, you will see the line being separated by dots and a blue line above.
    The line will look like this when the cursor is on it
  16. You can either move the a single segment to different state/condition by click-dragging the separated line…
    Dragging a broken line
    Or move the connected lines on the same stage/condition by click-dragging the blue line.
    Moving all connected segments
  17. You can get something like this after moving the lines:
  18. Right click on any empty space in the time frame, then click Edit Frame.
    edit Frame
  19. In the Edit Frame window, click Time Mesages > Add.
    Add time message
  20. In the Add Time Message window, name the time message, and set up the desire Start/End lifeline and time.
  21. Repeat step 19 and 20 for more time messages
  22. Right click the Safety Inspector lifeline, then select Edit Lifeline.
    edit lifeline
  23. In the Edit Lifeline window, select Duration Constraints > Add.
    add duration cinstraint
  24. In the Add Duration Constraint, select the Start/End time and set up the duration of the constraint, then click OK.
  25. Repeat step 23 and 24 for more duration constraints.
  26. After adding duration constraints, click OK on the Edit Lifeline window.
    finish adding time constraint
  27. You should get something similar when you are finishing the diagram:

Turn every software project into a successful one.