Re: Timing a program run?
On Thu, Jan 02, 2003 at 03:57:10AM -0600, Gerald Livingston wrote:
> OK -- dumb question that I can't remember the answer to and can't find
> by googling.
>
> How the heck do I time how long it takes a certain script to run?
>
> I've searched the archives and google and apropos and apt-cache on all
> kinds of variations of "time" (timing, timer, etc) and can't find
> anything.
`time <command>'
It's a bash built-in, at least for
bda@eos:~$ bash --version
GNU bash, version 2.05b.0(1)-release (i386-pc-linux-gnu)
This is the second hit I get from googling for `bash time built-in':
http://www.ss64.demon.co.uk/bash/time.html
...
bda@eos:~$ time ls -lF
total 32
drwxr-xr-x 15 bda bda 4096 Jan 1 05:41 Endymion/
drwx------ 2 bda bda 4096 Dec 17 08:21 Mail/
drwxr-xr-x 6 root root 4096 Dec 21 17:39 Media/
drwxr-xr-x 3 bda bda 4096 Dec 17 16:37 bin/
drwx------ 3 bda bda 4096 Dec 30 02:52 etc/
drwxr-sr-x 7 bda bda 4096 Dec 25 22:03 img/
drwxr-xr-x 6 bda bda 4096 Jan 2 05:01 tmp/
drwxr-sr-x 13 bda bda 4096 Dec 28 16:31 txt/
real 0m0.005s
user 0m0.000s
sys 0m0.010s
...
Other shells, YMMV.
--
bda
Cyberpunk is dead. Long live cyberpunk.
http://mirrorshades.org
Reply to: