stable2 (pas sûre, aller, en prod!)
This commit is contained in:
1 parent
a797fd0c1c
commit
ce977e2981
9 files changed
+47
-18
No files matched your search
@@ -0,0 +1,14 @@
|
||||
import aiohttp
|
||||
import time
|
||||
|
||||
url = "https://almtesh.net/"
|
||||
|
||||
async def get_api_ping():
|
||||
start_time = time.time()
|
||||
timeout = aiohttp.ClientTimeout(total=10)
|
||||
async with aiohttp.ClientSession(timeout=timeout) as session:
|
||||
async with session.get(url):
|
||||
pass
|
||||
end_time = time.time()
|
||||
ping = (end_time - start_time) * 1000
|
||||
return ping
|
||||
Reference in new issue
Block a user