[Toybox] uptime -s

Ryan Prichard rprichard at google.com
Thu May 14 16:48:58 PDT 2020


FWIW, the GNU "uptime -s" reports my seconds as 31, whereas busybox and
toybox alternate between 29 and 30.

$ uptime -s
2020-05-11 13:58:31

$ for i in $(seq 5); do sleep 0.5; busybox uptime -s; /x/toybox/toybox
uptime -s; done
2020-05-11 13:58:30
2020-05-11 13:58:30
2020-05-11 13:58:29
2020-05-11 13:58:29
2020-05-11 13:58:30
2020-05-11 13:58:30
2020-05-11 13:58:29
2020-05-11 13:58:29
2020-05-11 13:58:30
2020-05-11 13:58:30

-Ryan


On Thu, May 14, 2020 at 4:33 PM enh via Toybox <toybox at lists.landley.net>
wrote:

> http://landley.net/notes.html#02-05-2020
>
> Let's see:
>
> $ cat /proc/uptime
> 11514340.14 18323433.75
>
> Um, I'm guessing first number is runtime and second is suspend time
> (in seconds) since last reboot, toybox date -d @$(($(date
> +%s)-18323433)) says I last rebooted near the start of October. Yeah,
> sounds about right. I should probably do that so the kernel has a
> chance to refresh itself for security whatsits.
>
>
>
>
>
> it was people wanting to avoid exactly that kind of shell gymnastics
> that made me add -s to uptime :-)
> _______________________________________________
> Toybox mailing list
> Toybox at lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20200514/b0a91b6b/attachment-0001.htm>


More information about the Toybox mailing list