bug-bash
[Top][All Lists]
Advanced

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

Timing an operation


From: Matthew_S
Subject: Timing an operation
Date: Thu, 24 May 2007 03:22:48 -0700 (PDT)

Hi all,

I'm fairly new to Bash so if I appear slow that's the reason ;)

I'm trying to write a function that will give me the time it takes to do an
operation and then report to a logfile if it passes or fails.  What I have
so far is;

functionName()
{
        echo Timing the function. >> $LOG
        date
        $FUNCTION
        date
}

but this means I will manually have to calculate the difference between the
two dates.  Can i have something like;

if 
difference between dates <5seconds 
echo fail
fi

??

Thanks in advance,

Matthew.
-- 
View this message in context: 
http://www.nabble.com/Timing-an-operation-tf3809131.html#a10780790
Sent from the Gnu - Bash mailing list archive at Nabble.com.





reply via email to

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