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 re | |
import requests | |
import time | |
from bs4 import BeautifulSoup | |
from selectolax.parser import HTMLParser | |
def print_performance(func): | |
def wrapper(*args, **kwargs): |
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 | |
import time | |
def sync_print_performance(func): | |
def wrapper(*args, **kwargs): | |
begin = time.monotonic() | |
result = func(*args, **kwargs) | |
duration = time.monotonic() - begin | |
print(f'Time execution of {func.__name__}: {duration * 1000:.2f} ms') |
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 aiohttp | |
import asyncio | |
import time | |
import httpx | |
def print_performance(func): | |
async def wrapper(*args, **kwargs): | |
begin = time.monotonic() |