<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _wait(self, duration, steps, commands):
 """ Compute wait time. :param duration: Total time (in seconds). :param steps: Number of steps. :param commands: Number of commands. :returns: Wait in seconds. """

        wait = ((duration - self.wait * self.reps * commands) / steps) - \
               (self.wait * self.reps * self._bridge.active)
        return max(0, wait)