Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: math, percentage



"Brian K. White" <brian@xxxxxxxxx> writes:

> explicitly on the bang line. My biggest item about ksh93 lately is
> that it has a built-in sleep that takes floating point values. I have
> things that really do want a "sleep .1", and anything that wants that,
> by definition also really wants it built-in, not to fork a child and
> load an executable every time. No other shell anywhere has that that
> I've found. (hint!)  Perl has nap() and probably other popular non

According to zshmodules(1), you can use zselect to sleep with
approximately 1/100 sec. granulatiry.

typeset -F SECONDS
zmodload -i zsh/zselect
print $SECONDS
# sleep for 1/5 sec
zselect -t 20
print $SECONDS

On my system, this gives:

922.1230270000
922.3312820000

-Jonathan Hankins

-- 
+------------------+-----------------------------------------------------+
|Jonathan Hankins  | 		       	 jonathan-hankins@xxxxxxxxxxxxxx |
+------------------+-----------------------------------------------------+



Messages sorted by: Reverse Date, Date, Thread, Author