gagan f8b1fc15d8 An excursion timing class.
git-svn-id: svn://10.0.0.236/trunk@2132 18797224-902f-48f8-a5cc-f745e15eee43
1998-05-21 21:56:58 +00:00

25 lines
444 B
C++

/* A class to time excursion events */
/* declare an object of this class within the scope to be timed. */
#include <prtypes.h>
#include <prinrval.h>
class nsTimeIt
{
public:
nsTimeIt(PRUint32& tmp);
~nsTimeIt();
private:
PRIntervalTime t;
PRUint32& dest;
};
inline
nsTimeIt::nsTimeIt(PRUint32& tmp):t(PR_IntervalNow()), dest(tmp)
{
}
inline
nsTimeIt::~nsTimeIt()
{
dest = PR_IntervalToMicroseconds(PR_IntervalNow()-t);
}