Compute the duration of the timeline graph nodes.