[Techtalk] time a process took

conor.daly at cod.utvinternet.com conor.daly at cod.utvinternet.com
Wed Feb 9 20:40:32 EST 2005

On Tue, Feb 08, 2005 at 11:15:18PM -0600 or so it is rumoured hereabouts, 
Kathryn Hogg thought:
> Mary said:
> > I don't know of a way to attach something like this to a running
> > process.
> time strace -p $pid -e trace=none
> will give you the wall clock time that it spends running until it exits
> You could use a ps before starting the ps to get the start time and then
> figure out the end time - start time to calculate how long (wall clock) it
> ran for.

If it's in a script, I tend to just add 'date' commands around the
relevant command.

Conor Daly <conor.daly at oceanfree.net>

Domestic Sysadmin :-)
 09:39:53  up 1 day, 21:00,  1 user,  load average: 0.07, 0.03, 0.01

More information about the Techtalk mailing list