Mailing List
Home
Forum Home
Linux - General Red Hat Linux discussion list
Installation - Getting started with Red Hat Linux
Enterprise Linux 3 - Discussion of Red Hat Enterprise Linux 3 (Taroon)
Red Hat Linux 9 - Discussion of Red Hat Linux 9 (Shrike)
Red Hat Linux 7.2 - Discussion of Red Hat Linux 7.2 (Enigma)
Red Hat Linux 7.3 - Discussion of Red Hat Linux 7.3 (Valhalla)
Apache Web Server
Oracle database, Microsoft SQL server ...
Subjects
application/x mplayer2 plugin
RPM error: db4 error(16) from dbenv >remove: Device or resource
   busy
Command stream end of file while reading
X Windows problem (xauth)
Upgrading openoffice 1 1 rpm
FTP: connection refused
FTP: connection refused
mount: /dev/cdrom: is not a valid block device
Dell Precision 650, RedHat 9, no sound
how to trace the cause resulting in the crash of bind server
Virus on the list
UNINSTALL RPM MYSQL
usb pen drives: mounting as a user
broadcom network interface
make mrproper
sendmail configuration on redhat
Couldn 't open PID file /var/run/named/named pid Permission denied
Promise 378 controller
kernel 2 6 and /dev/sound/mixer not found
Problem using up2date
mrtg step by step howto/configuration for a newbie?
Compiling and Installing Kernel 2 6
Can 't locate module ppp0, can 't locate module ppp compress 21
HOW I CAN MAKE BOOTABLE FLOPPY DISKET
Lotus Notes under Wine
/etc/security/limits conf question
Intel E/1000 driver
Command stream end of file while reading
rpm database corrupt
qla2300 modules
 
SLOW syslog() function

SLOW syslog() function

2006-05-02       - By Ken Snider

 Back
Reply:     1     2     3     4     5  

Shaw, Marco wrote:

> I was going to give this a try on RHEL4, they maybe give
> systemtap a run at it.

Following Arjan's comments, I'm going to attempt to tweak I/O under RHEL3
and see what effect that has. the RHEL4 results will be interesting to see,
however.

> Where does this timevalue.h come from?

Gah, knew I'd forget that. Here's the file.

---

#include <sys/time.h>
class Time
{
    private:
        // the time value managed by this object
        struct timeval time_;

    public:
        /**
         * Constructor
         * Parameters: second - the initial value to set for
         *                      this object
         **/
        Time(long second = 0, long usecond = 0)
        {
           time_.tv_sec = second;
           time_.tv_usec = usecond;
        }

        /**
         * Copy Constructor
         **/
        Time(const Time& T) : time_(T.time_) {}

        /**
         * Method: MilliSecond
         * Parameters: None.
         * Returns: time in milli-seconds.
         **/
        long MilliSecond() const
        {
           return ((time_.tv_sec * 1000) + (time_.tv_usec / 1000));
        }

       /**
         * Method: CurrentTime
         * Parameters: None.
         * Returns: Nothing.
         * Purpose: Set the time value of this object to be
         *          the current time
         **/
        void CurrentTime() { gettimeofday(&time_, NULL); }

        /**
         * Operator: -=
         * Parameters: T - the RHS of the equation
         * Returns: Time& to this object.
         * Purpose: Specify functionality of the
         *          decrement-by and assign operator
         **/
        Time& operator-= (const Time& T)
        {
           long long t1, t2;
           t1 = (long long)time_.tv_sec;
           t1 *= USECONDS_PER_SECOND;
           t1 += (long long)time_.tv_usec;

           t2 = (long long)T.time_.tv_sec;
           t2 *= USECONDS_PER_SECOND;
           t2 += (long long)T.time_.tv_usec;

           t1 -= t2;

           time_.tv_sec = (long)(t1 / USECONDS_PER_SECOND);
           time_.tv_usec = (long)(t1 % USECONDS_PER_SECOND);

           return *this;
        }
};

/**
 * Operator: -
 * Parameters: lhs - the leftmost opperand
 *             rhs - the rightmost opperand
 * Returns: const Time containing the result of lhs - rhs.
 * Purpose: Perform the addition of lhs - rhs.
 **/
inline const Time operator- (const Time& lhs, const Time& rhs)
{
    Time T( lhs );
    T -= rhs;
    return T;
}

---

--
Ken Snider

--
Taroon-list mailing list
Taroon-list@(protected)
https://www.redhat.com/mailman/listinfo/taroon-list