Date: Mon, 18 Jul 2022 08:45:22 -0500 From: Tom Browder <tom.browder@gmail.com> To: Frank Leonhardt <freebsd-doc@fjl.co.uk> Cc: freebsd-questions@freebsd.org Subject: Re: How do get elapsed time in milliseconds in a shell script? Message-ID: <CAFMGiz8NcH1BMiRkftz67qd=6jicvPzrfagr40hSN94i87jxVw@mail.gmail.com> In-Reply-To: <4c98bb6d-a128-d10b-a896-6af11c06d41c@fjl.co.uk> References: <4c98bb6d-a128-d10b-a896-6af11c06d41c@fjl.co.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000058e2d05e41495a6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jul 12, 2022 at 03:09 Frank Leonhardt <freebsd-doc@fjl.co.uk> wrote= : > I thought this would be easy, but it's not! > > I can get the time since the epoch to the nearest second (date +%s), but > nothing more accurate. This was probably good enough in the 1970s but I > think it's reasonable to want a better resolution even in a shell script. I=E2=80=99m a wannabe FreeBSD user lurking here. Can you tell us more about= your use case? (Spoiler alert: I=E2=80=99m a long time Unix/Linux user who now relies mos= tly on Raku for other than very simple bash scripts.) Best regards, -Tom --000000000000058e2d05e41495a6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div><br></div><div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class= =3D"gmail_attr">On Tue, Jul 12, 2022 at 03:09 Frank Leonhardt <<a href= =3D"mailto:freebsd-doc@fjl.co.uk">freebsd-doc@fjl.co.uk</a>> wrote:<br><= /div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-le= ft:1px #ccc solid;padding-left:1ex">I thought this would be easy, but it= 9;s not!<br> <br> I can get the time since the epoch to the nearest second (date +%s), but <b= r> nothing more accurate. This was probably good enough in the 1970s but I <br= > think it's reasonable to want a better resolution even in a shell scrip= t.</blockquote><div dir=3D"auto"><br></div><div dir=3D"auto">I=E2=80=99m a = wannabe FreeBSD user lurking here. Can you tell us more about your use case= ?</div><div dir=3D"auto"><br></div><div dir=3D"auto">(Spoiler alert: =C2=A0= I=E2=80=99m a long time Unix/Linux user who now relies mostly on Raku for o= ther than very simple bash scripts.)</div><div dir=3D"auto"><br></div><div = dir=3D"auto">Best regards,</div><div dir=3D"auto"><br></div><div dir=3D"aut= o">-Tom</div></div></div> --000000000000058e2d05e41495a6--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFMGiz8NcH1BMiRkftz67qd=6jicvPzrfagr40hSN94i87jxVw>