im=Image.open("lena.jpg")
elapsed_time=0
-for i in range(100):
+for i in range(10):
t = time.process_time()
im.save("lena2.jpg",quality=quality)
elapsed_time += time.process_time() - t
-
elapsed_time=0
-for i in range(100):
+for i in range(10):
t = time.process_time()
im2=im.resize((256, 256))
im2.save("lena3.jpg",quality=quality)
print("time resize + pil",elapsed_time)
-
+"""
img = cv2.imread('lena.jpg')
elapsed_time += time.process_time() - t
print("time resize + cv2",elapsed_time)
+"""
+
elapsed_time=0
+t = time.process_time()
for i in range(10):
- t = time.process_time()
- proc=subprocess.Popen("scp lena4.jpg bilbo:/tmp", shell=True)
- proc.wait()
- elapsed_time += time.process_time() - t
+ proc=subprocess.Popen("scp lena3.jpg bilbo.iut-bm.univ-fcomte.fr:/tmp", shell=True)
+ proc.wait()
+
+elapsed_time += time.process_time() - t
print("ssh normal",elapsed_time)
elapsed_time=0
+t = time.process_time()
for i in range(10):
- t = time.process_time()
- proc=subprocess.Popen("scp lena5.jpg bilbo:/tmp", shell=True)
+
+ proc=subprocess.Popen("scp lena3.jpg bilbo.iut-bm.univ-fcomte.fr:/tmp", shell=True)
proc.wait()
- elapsed_time += time.process_time() - t
+elapsed_time += time.process_time() - t
print("ssh reduce",elapsed_time)