Created
August 27, 2017 20:10
-
-
Save pfreixes/baea4ecc7b5380d534d60a8c1e8da32f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from aiohttp.signals import Signal | |
from unittest.mock import Mock | |
signal = Signal(Mock()) | |
async def run_signal(loop, signals): | |
start = loop.time() | |
for i in range(signals): | |
await signal.send() | |
dt = loop.time() - start | |
print("Signals per second: {}".format(signals/dt)) | |
loop = asyncio.get_event_loop() | |
loop.run_until_complete(run_signal(loop, 1000000)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment