#!/bin/sh
SUM = 0
for i in {1..5}
do
t=$((/ usr / bin / time-f '% e' openssl enc -aes-128-ecb -K 1234567890 -in t -out g 1> /dev/null) 2> &1)
SUM = 'bc <<<" $ SUM + $ t "'
done
res = bc <<< "scale = 4; $ SUM / 5"
echo $res
The above code shows the average time of the 5 replicates of openssl using the AES cipher. Getting the same idea, how can I get maximum memory consumption?