bug-bash
[Top][All Lists]
Advanced

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

Re: Timing an operation


From: Chet Ramey
Subject: Re: Timing an operation
Date: Thu, 24 May 2007 12:00:40 -0400
User-agent: Thunderbird 2.0.0.0 (Macintosh/20070326)

Paul Jarc wrote:

> date1=`perl -e 'print time()'`
> ...
> date2=`perl -e 'print time()'`
> interval=`expr "$date2" - "$date1"`

This general approach can be used without invoking any external programs:

date1=$SECONDS
...
date2=$SECONDS
interval=$(( $date2 - $date1 ))

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                       Live Strong.  No day but today.
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/




reply via email to

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