⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rate.awk

📁 实现linux系统和网络时钟服务器的时间同步,从而可以得到准确的时间.
💻 AWK
字号:
(FNR==1){ day_off=$1;        t1=$2; o1=$5; f1=$7}        { t2=($1-day_off)*86400+$2; o2=$5; f2=$7; if (f2!=f1) fwarn=1}END{  print "delta-t",t2-t1,"seconds"  print "delta-o",o2-o1,"useconds"  if (fwarn) print " *** frequency changed in the middle - don't use ***"  slope=(o2-o1)/(t2-t1)  print "slope",slope,"ppm"  print "old frequency",f1,"(",f1/65536,"ppm)"  f3=f1+int(slope*65536);  print "new frequency",f3,"(",f3/65536,"ppm)"}# the final value is what you should push into the adjtimex(2) field.# i.e., if the last line shows# new frequency -1318109 ( -20.1127 ppm)# you put -1318109 into the -f switch of adjtimex (e.g., adjtimex -f -1318109)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -