Created
May 1, 2020 14:04
-
-
Save delivrance/87a9d8cca3e17e86f17e4286e137b833 to your computer and use it in GitHub Desktop.
Pyrogram upload speedtest
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
from pyrogram import Client | |
import time | |
app = Client("...") | |
async def main(): | |
async with app: | |
m = await app.send_message("pyrogramchat", "uploading 1500 MB...") | |
s = time.time() | |
m = await m.reply_document("file.test") # Create with: truncate -s 1500M file.test | |
e = time.time() - s | |
await m.reply_text(f"`avg {1500 / e * 8:.2f} Mbps`") # Should be ~250 Mbps | |
app.run(main()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello I get this error:
Python version: 3.6.9