MCPcopy Index your code
hub / github.com/PokemonGoF/PokemonGo-Bot / throttle_sleep

Method throttle_sleep

pokemongo_bot/api_wrapper.py:281–291  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

279 return PGoApiRequest.__getattr__(self, func)
280
281 def throttle_sleep(self):
282 now_milliseconds = time.time() * 1000
283 required_delay_between_requests = 1000 / self.requests_per_seconds
284
285 difference = now_milliseconds - (self.last_api_request_time if self.last_api_request_time else 0)
286
287 if self.last_api_request_time != None and difference < required_delay_between_requests:
288 sleep_time = required_delay_between_requests - difference
289 time.sleep(sleep_time / 1000)
290
291 return now_milliseconds

Callers 1

callMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected