+_autotime(){
+ local new_time
+ local duration
+
+ if [ "${_auto_timing}" -eq "1" ] ; then
+ new_time=$("${TIME_SCRIPT}")
+ duration=$(awk "BEGIN { printf(\"%f\n\", ($new_time - $_last_time)*1000) }")
+ echo " ---"
+ echo " duration_ms: ${duration}"
+ echo " ..."
+ fi
+ _last_time=$("${TIME_SCRIPT}")
+ return 0
+}
+
+
+autotime(){
+ local val=${1:?}
+
+ if [[ "${val}" != "0" ]] ; then
+ _auto_timing=1
+ else
+ _auto_timing=0;
+ fi
+ return 0
+}