def _wait(self):
        "ensure at least 1/max_rate seconds from last call"
        elapsed = time.time() - self.last_called
        must_wait = 1 / self.max_rate - elapsed
        time.sleep(max(0, must_wait))
        self.last_called = time.time()
ensure at least 1/max_rate seconds from last call
product/runtime/src/main/python/pkg_resources/_vendor/jaraco/functools.py