On 2/25/16 8:18 AM, Stephane Chazelas wrote: > Similar features would be welcome in bash. > > bash has "times" that gives you CPU time with sub-second > granularity. It's got a "printf %T" a la ksh93, but no %N, its > $SECOND is only integer (and currently has that issue discussed > here).
Because bash doesn't have floating point arithmetic. There's no real reason to have $SECONDS in a format you can't use to perform calculations. Bash's %T implementation doesn't have %N because it uses the libc strftime(3), and as far as I know, no strftime provides it. I assume that ksh93 implements it internally as part of libast. Bash doesn't have a `sleep' builtin at all, but there is a loadable sleep builtin that offers sub-second granularity. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/