Answer the question
In order to leave comments, you need to log in
Detect file download time from VK in python?
How to detect the download time of a file from VK in python?
import urllib.request
url = "https://любаяпикча.jpg"
img = urllib.request.urlopen(url).read()
out = open("img.jpg", "wb")
out.write(img)
out.close
Answer the question
In order to leave comments, you need to log in
import urllib.request
import time
url = "https://любаяпикча.jpg"
start_time = int(round(time.time() * 1000))
img = urllib.request.urlopen(url).read()
out = open("img.jpg", "wb")
out.write(img)
out.close
end_time = int(round(time.time() * 1000)) - start_time
print(end_time)
It is possible like this:
from datetime import datetime
start = datetime.now()
# Ваш код
end = datetime.now()
print(end-start)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question