diff --git a/src/benchmark.sh b/src/benchmark.sh index ffa12fd9..70a1f42b 100644 --- a/src/benchmark.sh +++ b/src/benchmark.sh @@ -162,6 +162,7 @@ function ble-measure/.read-arguments { case $arg in (--) break ;; (--help) flags=h$flags ;; + (--no-print-progress) flags=V$flags ;; (--*) ble/util/print "ble-measure: unrecognized option '$arg'." flags=E$flags ;; @@ -170,7 +171,7 @@ function ble-measure/.read-arguments { for ((i=1;i<${#arg};i++)); do c=${arg:i:1} case $c in - (q) flags=q$flags ;; + (q) flags=qV$flags ;; ([ca]) [[ $c == a ]] && flags=a$flags ble-measure/.read-arguments.get-optarg && count=$optarg ;; @@ -266,9 +267,9 @@ function ble-measure { [[ $prev_n ]] && ((n/prev_n<=10 && prev_utot*n/prev_n&2 + [[ $flags != *V* ]] && printf '%s (x%d)...' "$command" "$n" >&2 ble-measure/.time "$command" || return 1 - [[ $flags != *q* ]] && printf '\r\e[2K' >&2 + [[ $flags != *V* ]] && printf '\r\e[2K' >&2 ((utot >= measure_threshold)) || continue prev_n=$n prev_utot=$utot @@ -278,12 +279,12 @@ function ble-measure { if [[ $count ]]; then local sum_utot=$utot sum_count=1 i for ((i=2;i<=count;i++)); do - [[ $flags != *q* ]] && printf '%s' "$command (x$n $i/$count)..." >&2 + [[ $flags != *V* ]] && printf '%s' "$command (x$n $i/$count)..." >&2 if ble-measure/.time "$command"; then ((utot&2 + [[ $flags != *V* ]] && printf '\r\e[2K' >&2 done if [[ $flags == *a* ]]; then ((utot=sum_utot/sum_count)) diff --git a/src/util.sh b/src/util.sh index c462f652..d4471c59 100644 --- a/src/util.sh +++ b/src/util.sh @@ -3178,7 +3178,7 @@ _ble_util_msleep_calibrate_count=0 function ble/util/msleep/.calibrate-loop { local _ble_measure_threshold=10000 local ret nsec _ble_measure_count=1 v=0 - _ble_util_msleep_delay=0 ble-measure 'ble/util/msleep 1' + _ble_util_msleep_delay=0 ble-measure -q 'ble/util/msleep 1' local delay=$((nsec/1000-1000)) count=$_ble_util_msleep_calibrate_count ((count<=0||delay<_ble_util_msleep_delay)) && _ble_util_msleep_delay=$delay # 最小値 # ((_ble_util_msleep_delay=(count*_ble_util_msleep_delay+delay)/(count+1))) # 平均値