2016-02-25 13:18:17 +0000, Stephane Chazelas:
[...]
> > function __age { declare ns=$(date +"%N"); declare -i
> > ms=${ns##+(0)}/1000000;
> > printf "%4d.%03d\n" $SECONDS $ms
> > }
> [...]
>
> I'm not sure how that gives you the time since startup.
> Currently, if bash is started at
>
> 00:00:00.7
>
> After 0.4 seconds (at 00:00:01.1), $SECONDS will be 1 (the "bug"
> I'm raising here). "ms" will be 100, so you'll print 1.100
> instead of 0.600. And with my suggested fix, you'd print 0.100.
0.400
Sorry, meant 0.400 above.
--
Stephane