[sclug] Performance tuning

Simon Huggins huggie at earth.li
Thu Nov 17 13:11:45 UTC 2005


On Wed, Nov 16, 2005 at 11:00:41PM +0000, Derek M Jones wrote:
> Short of editing the source of bash I cannot think of
> any way of obtaining the information I am after.  Does anybody
> have any ideas?  An accuracy of +/-10% would be good enough.

The low tech solution is to just call out to date at appropriate points
in your shell and then do the sums afterwards.

With GNU date, date +%s will give seconds since epoch so might ease the
calculations.

Stick calls to it at appropriate points in your script with some
descriptive echo "starting loop of process A" type things and then do
the sums later.

If you really wanted you could do the sums in the shell script.

Easier than LD_PRELOAD hacks at least and given you don't mind a fair
margin of error...

Simon

-- 
http://www.blackcatnetworks.co.uk/freestuff - Free stuff!


More information about the Sclug mailing list