void-packages/srcpkgs/clockspeed/files/clockspeed_adjust/clock_adjust.sh
TJ Vanderpoel 3299466d7e New package: clockspeed-0.62
clockspeed: remove unused template variable

clockspeed: make arch-specific for x86/x86_64

* Add NOTES about what the package contains
* Add README and INSTALL to docs

clockspeed: depend on sv-helper for supervision
2015-02-25 13:59:47 -06:00

26 lines
594 B
Bash
Executable file

#!/bin/sh
# from http://thedjbway.b0llix.net/clocksd/index.html
#
# clock_adjust.sh
# periodically get timing mark for clockspeed service
# initialize WAIT, WAIT_MAX:
WAIT=541
WAIT_MAX=2617923
# loop indefinitely
while :
do
# obtain timing mark for calibrating clockspeed adjust:
clockctl mark
# log current "attoseconds":
clockctl atto
echo "==="
echo "Waiting ${WAIT} seconds until next adjustment..."
sleep ${WAIT}
# increment $WAIT:
WAIT=`expr ${WAIT} + ${WAIT} + ${WAIT}`
if [ ${WAIT} -gt ${WAIT_MAX} ] ; then
WAIT=${WAIT_MAX}
fi
done