Return a timedelta for this task.

        Measure the time between this task's start and end time, or "now"
        if the task has not yet finished.

        :returns: timedelta object, or None if the task has not even started.

def duration(self):
        """
        Return a timedelta for this task.

        Measure the time between this task's start and end time, or "now"
        if the task has not yet finished.

        :returns: timedelta object, or None if the task has not even started.
        """
        if not self.started:
            return None
        start = self.started
        end = self.completed
        if not end:
            end = datetime.utcnow()
        return end - start