Assumes you hold the lock

def _print_if_needed(self):
        """Assumes you hold the lock"""
        if self._in_txn or self.print_frequency is None:
            return
        elif self.last_export is not None and \
             self.last_export + self.print_frequency > time.time():
            return

        self.export()