[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: was there a more fine number than $SECONDS for the same purpose
From: |
Tapani Tarvainen |
Subject: |
Re: was there a more fine number than $SECONDS for the same purpose |
Date: |
Sun, 7 Nov 2021 15:34:12 +0200 |
On Sun, Nov 07, 2021 at 08:17:56AM -0500, Greg Wooledge (greg@wooledge.org)
wrote:
> You can store the value of EPOCHREALTIME in a different variable at the
> start of your script, and then retrieve it again later on, and subtract
> the two. However, subtracting the two values will require forking an
> external program, because bash can't do it.
Well bash can do it, if you save the values as microseconds.
$EPOCHREALTIME always has six decimal points, it doesn't omit
trainling zeroes, so it's pretty easy. E.g.,
START=${EPOCHREALTIME/[[:punct:]]/}
...
NOW=$(( ${EPOCHREALTIME/[[:punct:]]/} - START ))
--
Tapani Tarvainen
- was there a more fine number than $SECONDS for the same purpose, Alex fxmbsw7 Ratchev, 2021/11/07
- Re: was there a more fine number than $SECONDS for the same purpose, Dennis Williamson, 2021/11/07
- Re: was there a more fine number than $SECONDS for the same purpose, Alex fxmbsw7 Ratchev, 2021/11/07
- Re: was there a more fine number than $SECONDS for the same purpose, Greg Wooledge, 2021/11/07
- Re: was there a more fine number than $SECONDS for the same purpose,
Tapani Tarvainen <=
- Re: was there a more fine number than $SECONDS for the same purpose, Tapani Tarvainen, 2021/11/07
- Re: was there a more fine number than $SECONDS for the same purpose, Alex fxmbsw7 Ratchev, 2021/11/07
- Re: was there a more fine number than $SECONDS for the same purpose, Tapani Tarvainen, 2021/11/07
- Re: was there a more fine number than $SECONDS for the same purpose, Alex fxmbsw7 Ratchev, 2021/11/07
- Re: was there a more fine number than $SECONDS for the same purpose, Alex fxmbsw7 Ratchev, 2021/11/07
Re: was there a more fine number than $SECONDS for the same purpose, Tapani Tarvainen, 2021/11/07