/proc/uptime is much simplier :-)
---
     Luiz Angelo Daros de Luca, Me.
            [email protected]


2012/11/23 Bastian Bittorf <[email protected]>:
>> not possible to get more resolution than 1 second, at least with
>> the
>> date command. I'd like to know if there's a way to get a resolution
>
> you can start with 'date +%s'
> the tic() toc() approach is nice, here is what
> we do to measure exact time between 2 events:
>
> read t1 trash </proc/uptime
> do_something()
> read t2 trash </proc/uptime
> duration=$(( ${t2//./} - ${t1//./} ))
> logger -s "lasts $(( $duration / 100 )).$(( $duration % 100 )) sec"
>
> which outputs something like:
> "lasts 7.64 sec"
>
> bye, bastian
> _______________________________________________
> openwrt-devel mailing list
> [email protected]
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to