From 1675b71b9488fd8b62558d9af2e30b4f9d150849 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Couturier?= Date: Sun, 27 Jun 2021 20:22:59 +0200 Subject: [PATCH 1/1] new --- measure_energy_iot/image_compression.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/measure_energy_iot/image_compression.py b/measure_energy_iot/image_compression.py index 3000f67..6e99203 100644 --- a/measure_energy_iot/image_compression.py +++ b/measure_energy_iot/image_compression.py @@ -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) -- 2.39.5