Time borken on ARM

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Time borken on ARM

kryptonite
The below function refers to which time and there is no binary called time. Is there a particular time binary i need to compile ?

timed_run()
{
        # We do not need to use built-in "time" command, as it may
        # have very different options and output format
        time_output=`mktemp`
        time_cmd="`which time` -p -o $time_output"

        # We can specify "to_dev_null" to redirect stdout to /dev/null
        if echo "$@" | grep -q "to_dev_null"; then
                shift
                $time_cmd $@ >/dev/null 2>$DEBUG_TTY && timed_run_success || timed_run_failure
        else
                $time_cmd $@ >$DEBUG_TTY 2>&1 && timed_run_success || timed_run_failure
        fi
}
Reply | Threaded
Open this post in threaded view
|

Re: Time borken on ARM

kryptonite
Ignore this was solved sudo apt-get install time

:)
Reply | Threaded
Open this post in threaded view
|

Re: Time borken on ARM

Michael Shigorin
In reply to this post by kryptonite
On Thu, Jul 12, 2012 at 10:13:06PM -0700, kryptonite wrote:
> The below function refers to which time and there is no binary called time.
> Is there a particular time binary i need to compile ?

If a shell builtin will do (the output format might differ),
then the test might be fixed to use type -t; if it won't,
try building e.g. http://sisyphus.ru/en/srpm/time/get

$ /usr/bin/time /bin/true
0.00user 0.00system 0:00.00elapsed ?%CPU (0avgtext+0avgdata 240maxresident)k
0inputs+0outputs (0major+32minor)pagefaults 0swaps
$ bash -c 'time /bin/true'    
0.00user 0.00system 0:00.00elapsed ?%CPU (0avgtext+0avgdata 256maxresident)k
0inputs+0outputs (0major+31minor)pagefaults 0swaps
$ zsh -c 'time /bin/true'
/bin/true  0.00s user 0.00s system 0% cpu 0.001 total

--
 ---- WBR, Michael Shigorin <[hidden email]>
  ------ Linux.Kiev http://www.linux.kiev.ua/

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
inq-discuss-en mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/inq-discuss-en