Skip to content

Instantly share code, notes, and snippets.

@1st1
Created January 15, 2014 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1st1/8446175 to your computer and use it in GitHub Desktop.
Save 1st1/8446175 to your computer and use it in GitHub Desktop.
import asyncio
import time
I = 0
def test2():
yield from ()
global I
I += 1
def test():
for i in range(10**5):
yield from asyncio.Task(test2())
loop = asyncio.get_event_loop()
st = time.monotonic()
loop.run_until_complete(test())
print(time.monotonic() - st)
print(I)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment