import asyncio
import random
import time
import aiohttp
from aiohttp import ClientSession
async def login(i):
async with ClientSession() as session:
res = await session.post(url="http://10.0.104.48:18010/account/api/login", data={'password': '12345', 'mobile': '13488985003'})
a = await res.json()
print(i)
async def main():
res = await asyncio.gather(*(login(i) for i in range(500)))
return res
if __name__ == "__main__":
a = time.time()
asyncio.run(main())
print(time.time() - a)
网友评论