shorter lua sleep

This commit is contained in:
bol-van 2023-11-03 09:47:15 +03:00
parent 65ed5ab2f5
commit 005a930df4

View File

@ -212,7 +212,7 @@ fsleep_setup()
elif ucode -e "system(['sleep','1'], 1)" 2>/dev/null; then elif ucode -e "system(['sleep','1'], 1)" 2>/dev/null; then
FSLEEP=4 FSLEEP=4
# older openwrt may have lua and nixio lua module # older openwrt may have lua and nixio lua module
elif lua -e 'local nixio = require "nixio"; nixio.nanosleep(0,1);' 2>/dev/null ; then elif lua -e 'require "nixio".nanosleep(0,1)' 2>/dev/null ; then
FSLEEP=5 FSLEEP=5
else else
FSLEEP=0 FSLEEP=0
@ -236,7 +236,7 @@ minsleep()
ucode -e "system(['sleep','1'], 100)" ucode -e "system(['sleep','1'], 100)"
;; ;;
5) 5)
lua -e 'local nixio = require "nixio"; nixio.nanosleep(0,100000000);' lua -e 'require "nixio".nanosleep(0,100000000)'
;; ;;
*) *)
sleep 1 sleep 1