<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def duration(self):
 """ Returns task's current duration in minutes. """


        if not self._loaded:
            return 0

        delta = datetime.datetime.now() - self._start_time
        total_secs = (delta.microseconds +
                      (delta.seconds + delta.days * 24 * 3600) *
                      10 ** 6) / 10 ** 6

        return max(0, int(round(total_secs / 60.0)))