code: def duration(self):
          
          duration = 0.0
          if len(self.events) > 0:
              first = datetime.fromtimestamp(self.events[0]['timestamp'])
              last = datetime.fromtimestamp(self.events[-1]['timestamp'])
              duration = (last - first).total_seconds()
          return duration
docs: Calculate how long the stage took.
  
          Returns:
              float: (current) duration of the stage