linux - How can I "delay" in Zsh with a float-point number? -


in zsh there wait (for process or job) command, while (seconds == delay) command, , sched (do later if shell still running) command, no "delay" command. if there were, fear limited whole second delays. need "delay" statement can cause procedure/task nothing time specified in fixed point number or until clock time.

most scripts use "sleep", have delay timer run without having open io; seeking ideal can accomplished within zsh.

does know how perhaps make function (or maybe builtin/module) perform floating point idle delay in seconds?

i'll argue making wrong assumption. zsh shell, , therefore purpose shell. 1 important point in being shell posix compatible shell. since zsh backward compatible bash, in turn backward compatible bourne shell should poisx shell.

that means zsh must have access sleep since sleep required posix shell.

and far go posix compatibility argument. practical use argument. systems use gnu coreutils sleep implement sleep allow floating point arguments. therefore following posix portable:

if ! sleep 0.03;     sleep 1 fi 

and should work fine grained delay in cases, whilst still not break in rare cases os not use gnu coreutils. far aware these rare cases aix , hp-ux systems.


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -