gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnu-arch-users] Timing each command


From: Zenaan Harkness
Subject: [Gnu-arch-users] Timing each command
Date: Mon, 18 Oct 2004 15:14:58 +1000

> > automatically timing every command,
> 
>         I'm not sure I know what you mean, but perhaps
> 
> export PS1='\T address@hidden:\w\$ '    # Inserts current time (\T) in shell 
> prompt
> 
>         or something like that? If you want seconds elapsed between prompts,
> you can try something with the PROMPT_COMMAND variable, using command
> substitution (`` or $()), and maybe an auxiliary file:
> 
> export PROMPT_COMMAND='echo -n $[$(date +%s) - $(cat ~/.bash-timestamp)];date 
> +%s > ~/.bash-timestamp'

I read this request as: timing the duration of a
command-as-forked-by-shell. Meaning the time between when the <ENTER>
key was last pressed, and the time the next shell prompt appears.

I can see how this could become a useful regular barometer of things.

I can't offer a ready solution though sorry...

cheers
zen




reply via email to

[Prev in Thread] Current Thread [Next in Thread]