Ethereal-dev: Re: [ethereal-dev] High resolution timers

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Lyle Bickley <lpb@xxxxxxxx>
Date: Tue, 05 Jan 1999 11:53:17 -0800
Christian Brunner wrote:
> 
> Since I'm at writing mails, I want to ask a question, too. Maybe someone
> has an idea.
> 
> I want to generate a constant load on the network, sending out arbitrary
> packets. The problem is, that I have to send out the packets at a fairly
> high rate (especially on fast networks). My first idea was to simply use
> an alarm timer to do this, but under x86-Linux (I don't think other
> systems make to much of a difference here) the kernel timer has a
> resolution of 20ms, which is half an eternity, when I have to send out a
> packet every 50 microsecond.

You might want to look at the high resolution timer used by the SMP
folks (See time.c in arch/i386/kernel).  To use it you have to configure
Linux under "Character Devices" to include "Enhanced Real Time Clock
Support".  The enhanced timer supports microsecond or better ticks.

Lyle
-- 
Lyle P. Bickley  |  Bickley Consulting West Inc.
lpb@xxxxxxxxxxx  |  1697 Grant Road
V 650-428-0621   |  Mountain View, CA 94040
F 650-428-0599   |