From 33996e0790e42d311ac3c4e04f92759acb697bde Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Couturier?= Date: Sun, 11 Jul 2021 18:01:57 +0200 Subject: [PATCH 1/1] update --- measure_energy_iot/image_compression.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/measure_energy_iot/image_compression.py b/measure_energy_iot/image_compression.py index c33b8db..da8f6b3 100644 --- a/measure_energy_iot/image_compression.py +++ b/measure_energy_iot/image_compression.py @@ -11,7 +11,7 @@ print("quality ",quality) 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 @@ -21,9 +21,8 @@ print("time pil",elapsed_time) - 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) @@ -31,7 +30,7 @@ for i in range(100): print("time resize + pil",elapsed_time) - +""" img = cv2.imread('lena.jpg') @@ -54,22 +53,26 @@ for i in range(100): 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.iut-bm.univ-fcomte.fr:/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.iut-bm.univ-fcomte.fr:/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) -- 2.39.5