A
lgorithmique
N
umérique
D
istribuée
Private GIT Repository
projects
/
Cipher_code.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
new
[Cipher_code.git]
/
measure_energy_iot
/
image_compression.py
diff --git
a/measure_energy_iot/image_compression.py
b/measure_energy_iot/image_compression.py
index 4c0c55547fe28023a364675a051c0ecca8fc8838..03aafcd926e66614546c7278c4f6a5310d5298f5 100644
(file)
--- a/
measure_energy_iot/image_compression.py
+++ b/
measure_energy_iot/image_compression.py
@@
-10,11
+10,11
@@
print("quality ",quality)
im=Image.open("lena.jpg")
elapsed_time=0
im=Image.open("lena.jpg")
elapsed_time=0
-
+t = time.time()
for i in range(10):
for i in range(10):
- t = time.process_time()
+
im.save("lena2.jpg",quality=quality)
im.save("lena2.jpg",quality=quality)
-
elapsed_time += time.process_
time() - t
+
elapsed_time += time.
time() - t
print("time pil",elapsed_time)
print("time pil",elapsed_time)
@@
-22,12
+22,12
@@
print("time pil",elapsed_time)
elapsed_time=0
elapsed_time=0
+t = time.time()
for i in range(10):
for i in range(10):
- t = time.process_time()
+
im2=im.resize((256, 256))
im2.save("lena3.jpg",quality=quality)
im2=im.resize((256, 256))
im2.save("lena3.jpg",quality=quality)
- elapsed_time += time.process_time() - t
-
+elapsed_time += time.time() - t
print("time resize + pil",elapsed_time)
"""
print("time resize + pil",elapsed_time)
"""
@@
-57,22
+57,20
@@
print("time resize + cv2",elapsed_time)
elapsed_time=0
elapsed_time=0
-t = time.
process_
time()
+t = time.time()
for i in range(10):
proc=subprocess.Popen("scp lena2.jpg bilbo.iut-bm.univ-fcomte.fr:/tmp", shell=True)
proc.wait()
for i in range(10):
proc=subprocess.Popen("scp lena2.jpg bilbo.iut-bm.univ-fcomte.fr:/tmp", shell=True)
proc.wait()
-
-elapsed_time += time.process_time() - t
+elapsed_time += time.time() - t
print("ssh normal",elapsed_time)
elapsed_time=0
print("ssh normal",elapsed_time)
elapsed_time=0
-t = time.
process_
time()
+t = time.time()
for i in range(10):
proc=subprocess.Popen("scp lena3.jpg bilbo.iut-bm.univ-fcomte.fr:/tmp", shell=True)
proc.wait()
for i in range(10):
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.time() - t
print("ssh reduce",elapsed_time)
print("ssh reduce",elapsed_time)