Re: [OpenWrt-Devel] milliseconds time measurements

2012-11-27 Thread Gabriel
@lists.openwrt.org Sent: Friday, November 23, 2012 3:14:09 PM Subject: Re: [OpenWrt-Devel] milliseconds time measurements Thank you for your answers! I've tried with the time command, but I couldn't use it for various commands together as in my pc using parentheses like time (command 1; command 2

Re: [OpenWrt-Devel] milliseconds time measurements

2012-11-26 Thread Etienne Champetier
- Original Message - From: Gabriel gto...@inti.gob.ar To: openwrt-devel@lists.openwrt.org Sent: Friday, November 23, 2012 3:14:09 PM Subject: Re: [OpenWrt-Devel] milliseconds time measurements Thank you for your answers! I've tried with the time command, but I couldn't use it for various

Re: [OpenWrt-Devel] milliseconds time measurements

2012-11-23 Thread Bastian Bittorf
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

Re: [OpenWrt-Devel] milliseconds time measurements

2012-11-23 Thread Luiz Angelo Daros de Luca
/proc/uptime is much simplier :-) --- Luiz Angelo Daros de Luca, Me. luizl...@gmail.com 2012/11/23 Bastian Bittorf bitt...@bluebottle.com: 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

Re: [OpenWrt-Devel] milliseconds time measurements

2012-11-23 Thread Bastian Bittorf
/proc/uptime is much simplier :-) and it's even monotonic...and...fast. (date +%s can jump into future and past) read t1 trash /proc/uptime do_something() read t2 trash /proc/uptime ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org

Re: [OpenWrt-Devel] milliseconds time measurements

2012-11-23 Thread Gabriel
Thank you for your answers! I've tried with the time command, but I couldn't use it for various commands together as in my pc using parentheses like time (command 1; command 2) with date +%s I get a seconds count: root@E10:~# while true; do date; date +%s; sleep 1; done Fri Nov 23 17:10:11

Re: [OpenWrt-Devel] milliseconds time measurements

2012-11-23 Thread John Lauro
PM Subject: Re: [OpenWrt-Devel] milliseconds time measurements Thank you for your answers! I've tried with the time command, but I couldn't use it for various commands together as in my pc using parentheses like time (command 1; command 2) with date +%s I get a seconds count: root@E10:~# while

[OpenWrt-Devel] milliseconds time measurements

2012-11-22 Thread Gabriel
Hi, I'm using TP-Link WR741ND routers with openwrt, and I want to log some debug files, to know for example how many packets have been transmitted in a period of time. For that purpose I use while loops and log the results. The problem is that I couldn't find how to use a good time reference

Re: [OpenWrt-Devel] milliseconds time measurements

2012-11-22 Thread Luiz Angelo Daros de Luca
Just (ab)use any other time function like time tic() { TICFILE=$(mktemp); rm $TICFILE; mkfifo $TICFILE; ((TIME=$(time cat $TICFILE 21 | sed -rne '/real/{s/^real[[:blank:]]*//;p}'); echo $TIME$TICFILE ) )2/dev/null; } toc() { echo -n $TICFILE; awk BEGIN { print $(cat $TICFILE | sed -e 's/m/ * 60