]> AND Private Git Repository - Cipher_code.git/commitdiff
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
new
authorRaphaël Couturier <raphael.couturier@univ-fcomte.fr>
Sun, 27 Jun 2021 18:22:59 +0000 (20:22 +0200)
committerRaphaël Couturier <raphael.couturier@univ-fcomte.fr>
Sun, 27 Jun 2021 18:22:59 +0000 (20:22 +0200)
measure_energy_iot/image_compression.py

index 3000f67dd5beeed92cc183c0af35172401d97555..6e99203be04db29b26cd639dc7a55a1b98c535f7 100644 (file)
@@ -1,6 +1,7 @@
 from PIL import Image
 import time
 import cv2
+import subprocess
 
 import sys
 
@@ -45,7 +46,7 @@ for i in range(100):
 print("time cv2",elapsed_time)
 
 
-
+elapsed_time=0
 for i in range(100):
     t = time.process_time()
     resized = cv2.resize(img, (256,256), interpolation=cv2.INTER_LINEAR)
@@ -53,3 +54,22 @@ for i in range(100):
     elapsed_time += time.process_time() - t
 
 print("time resize + cv2",elapsed_time)
+
+elapsed_time=0
+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
+
+print("ssh normal",elapsed_time)
+
+
+elapsed_time=0
+for i in range(10):
+    t = time.process_time()
+    proc=subprocess.Popen("scp lena5.jpg bilbo:/tmp", shell=True)
+    proc.wait()
+    elapsed_time += time.process_time() - t
+
+print("ssh reduce",elapsed_time)