code: def update_status(self, new_status):
          
          timestamp = time.time()
          self.status_history[-1]["end"] = timestamp
          self.status_history.append(
              {"start": timestamp, "end": None, "status": new_status}
          )
docs: Record a status change with a current timestamp.