summaryrefslogtreecommitdiff
path: root/ckt0.awk
diff options
context:
space:
mode:
authorwukong <wukong@longaeva>2026-11-25 03:29:26 -0800
committerwukong <wukong@longaeva>2026-11-25 03:29:26 -0800
commit9cabccd75fedbee0d3ae3646833410d775f6b956 (patch)
tree3fe4e8d8758e871ce0047b6247c2c2932b905072 /ckt0.awk
parentffa420cc9ecccc284510cac40456146be5c918a9 (diff)
refactored timing in main loop;HEADmaster
changed from for loop to while loop; added check for change in 'update' output string;
Diffstat (limited to '')
-rw-r--r--ckt0.awk15
1 files changed, 10 insertions, 5 deletions
diff --git a/ckt0.awk b/ckt0.awk
index 5e29dc8..54695ff 100644
--- a/ckt0.awk
+++ b/ckt0.awk
@@ -112,13 +112,17 @@ function ck_boottime(unm) {
function ck_time(unm) {
+ t = systime()
+
if (unm ~ /FreeBSD/ || unm ~ /Linux/) {
"date +%s.%N" | getline t
close("date +%s.%N")
}
else {
- "date +%s" | getline t
- close("date +%s")
+ #"date +%s" | getline t
+ #close("date +%s")
+ #"perl -w cktime.pl" | getline t
+ #close("perl -w cktime.pl")
}
return t
@@ -259,9 +263,9 @@ BEGIN {
dt_up_alt[2] = t_up_alt[2] + t_up_prev[2]
## additional error terms
- t_up_alt[2] += sqrt((dt_up_alt[1] - dt[1])^2.0)
+ t_up_alt[2] += sqrt((dt_up_alt[1] - dt[1])^2.0) + (dt_up_alt[2] + dt[2])
t_up_alt[2] += sqrt((t_up_alt[1] - t_up_est[1])^2.0)
- t_up_est[2] += sqrt((t_up_est[1] - t_up_alt[1])^2.0)
+ #t_up_est[2] += sqrt((t_up_est[1] - t_up_alt[1])^2.0)
## merge alt. prediction
split(merge_meas(t_up_est[1], t_up_est[2], t_up_alt[1], t_up_alt[2]), t_up_est)
@@ -280,7 +284,8 @@ BEGIN {
## additional error terms
t0_meas[2] += sqrt((t0_meas[1] - t0_est[1])^2.0)
- t0_est[2] += sqrt((t0_meas[1] - t0_est[1])^2.0)
+ # + (t0_meas[2] + t0_est[2])
+ #t0_est[2] += sqrt((t0_meas[1] - t0_est[1])^2.0) + (t0_meas[2] + t0_est[2])
## merge previous and updated boot time, t0
split(merge_meas(t0_meas[1], t0_meas[2], t0_est[1], t0_est[2]), t0_est)