You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
428 B

import asyncio
import util
@util.measure_performance_async
async def async_compute_task():
await asyncio.gather(*[util.async_compute_task() for _ in range(5)])
@util.measure_performance_async
async def async_io_task():
await asyncio.gather(*[util.fetch_url_async(url) for url in util.urls])
def main():
asyncio.run(async_compute_task())
asyncio.run(async_io_task())
if __name__ == "__main__":
main()