From 60c003a494dfb88b517fdfcaf72de1928a7ab839 Mon Sep 17 00:00:00 2001 From: udeved Date: Tue, 17 Feb 2015 20:53:59 +0100 Subject: [PATCH] [util-iso] add more timer statistics --- lib/util-iso.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/util-iso.sh b/lib/util-iso.sh index 0b1ff57..7fa9fd9 100644 --- a/lib/util-iso.sh +++ b/lib/util-iso.sh @@ -591,12 +591,20 @@ load_profile(){ done } +elapsed_time(){ + echo $(echo $1 $(date +%s) | awk '{ printf "%0.2f",($2-$1)/60 }') +} + compress_images(){ + timer_start_iso=$(date +%s) make_iso make_checksum "${iso_file}" + local timer_iso=$(elapsed_time "${timer_start_iso}") + msg3 "Finished compression in ${timer_iso} minutes" } build_images(){ + timer_start_images=$(date +%s) load_pkgs "Packages" make_image_root if [[ -f "${packages_custom}" ]] ; then @@ -622,6 +630,8 @@ build_images(){ fi make_isolinux make_isomounts + local timer_images=$(elapsed_time "${timer_start_images}") + msg3 "Finished Images in ${timer_images} minutes" } make_profile(){ @@ -645,8 +655,8 @@ make_profile(){ compress_images fi cd .. - local minutes=$(echo ${timer_start} $(date +%s) | awk '{ printf "%0.2f",($2-$1)/60 }') - msg "Finished building [$1] in ${minutes}" + local timer_finished=$(elapsed_time "${timer_start}") + msg "Finished building [$1] in ${timer_finished} minutes" }