From 7fb50be1944f3a76a285ac04423ae233728b5bf7 Mon Sep 17 00:00:00 2001 From: wukong Date: Tue, 9 Jun 2026 10:47:09 -0700 Subject: merge code between ckcptime and ckt0 scripts; added btime check from /proc/stat in ckt0.awk; --- ckcptime.sh | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'ckcptime.sh') diff --git a/ckcptime.sh b/ckcptime.sh index 697854b..466af59 100644 --- a/ckcptime.sh +++ b/ckcptime.sh @@ -3,18 +3,28 @@ # estimate sytem boot time # [debug] enable execution tracing -#set -x +# set -x set -e # raw input data #date +%s #sysctl kern.cp_time | awk -F= '{print($0)}' -#printf "sec\n" | column -t -for N in $(seq 0 15) ; do - #printf "${N} ${t0_est}\n" | column -t - awk -f ckcptime.awk - sleep $( awk 'BEGIN {print( rand()^2.0 + 1.0 )}' ) +t_prev='0' +t_curr=$( date +%s ) + +for N in $( seq 0 90 ) ; do + while [ $t_prev -eq $t_curr ] ; do + # sleep $( awk 'BEGIN {print(rand()^2.0 + rand()^2.0)}' ) + # sleep 0.707107 + sleep 1.41421 + t_curr=$( date +%s ) + done + if [ $t_prev -ne $t_curr ] ; then + awk -f ckcptime.awk + t_prev=$t_curr + fi + done # [debug] disable execution tracing -- cgit v1.2.3