Skip to content

Instantly share code, notes, and snippets.

View mushkevych's full-sized avatar

Dan Mushkevych mushkevych

  • Portland, OR, USA
View GitHub Profile
@Integralist
Integralist / Python Asyncio Timing Decorator.py
Last active June 30, 2024 09:27
Python Asyncio Timing Decorator
import asyncio
import time
def timeit(func):
async def process(func, *args, **params):
if asyncio.iscoroutinefunction(func):
print('this function is a coroutine: {}'.format(func.__name__))
return await func(*args, **params)
else: