summaryrefslogtreecommitdiff
path: root/ckcptime.sh
diff options
context:
space:
mode:
authorwukong <wukong@longaeva>2026-06-09 10:47:09 -0700
committerwukong <wukong@longaeva>2026-06-09 10:47:09 -0700
commit7fb50be1944f3a76a285ac04423ae233728b5bf7 (patch)
tree957548d230a9ab48eb80dac4d8ee5e493cbaea6d /ckcptime.sh
parent40548183b45666afc50373b0ee172465660fc479 (diff)
merge code between ckcptime and ckt0 scripts;
added btime check from /proc/stat in ckt0.awk;
Diffstat (limited to '')
-rw-r--r--ckcptime.sh22
1 files changed, 16 insertions, 6 deletions
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