Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import aioredis
- import asyncio
- OPS = 100000
- async def main(loop):
- conn = await aioredis.create_redis(('localhost', 6379))
- start = loop.time()
- for i in range(OPS):
- await conn.ping()
- lapsed = loop.time() - start
- print("Ping/sec {}".format(OPS/lapsed))
- if __name__ == '__main__':
- loop = asyncio.get_event_loop()
- loop.run_until_complete(main(loop))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement