def _step(self, initial):
        before = self._now()
        if before.hour == initial.hour and before.minute == initial.minute:
            clean_cache()

        future = before + datetime.timedelta(minutes = 1)
        future = future.replace(second = 0, microsecond = 0)
        self._run_all()
        after = datetime.datetime.now()

        remaining_seconds = (future - after).total_seconds()
        if remaining_seconds > 0:
            PIECES = 60
            per_second = remaining_seconds / PIECES
            for _ in xrange(PIECES):
                if self._stopping:
                    break
                time.sleep(per_second)
        else:
            print "Warning: the last run_all took: %s time" % (after - before).total_seconds()
dataset/ETHPy150Open gateway4labs/labmanager/labmanager/rlms/__init__.py/TaskRunner._step/original