Re: high accuracy timing options?
Re: high accuracy timing options?
- Subject: Re: high accuracy timing options?
- From: "Aaron Turner" <email@hidden>
- Date: Thu, 27 Mar 2008 14:06:43 -0700
On Thu, Mar 27, 2008 at 1:42 PM, Steve Sisak <email@hidden> wrote:
> At 3:14 PM -0400 3/27/08, Steve Sisak wrote:
> >Note this code is written in Eudora, not tested.
>
> Here's a working version with numbers for a MacBook Pro 2.16GHz:
>
> Still not sure what you're trying to do, but this is the same as your
> code minus "back", which can't happen -- hope this tells you
> something.
>
> Since UpTime() just returns the processor timebase register, I'm
> pretty sure it can't fail to increment.
>
> Note that the absolute value of fiveSeconds is going to vary based on
> processor architecture and speed.
>
> --------
[snip]
Wow, come back to my desk and i've got an inbox full of replies... thanks guys.
First since everyone keeps asking: I'm trying to introduce artificial
delays in my code in order to accurately send packets at a user
specified rate- generally in the range of a few packets/sec all the
way to 160,000+p/s which is about where you start running into the
hardware limits. Code is currently pretty portable: Linux, *BSD,
Solaris, OS X, Windows/Cygwin and even MIPS based hardware running on
the international space station or so I've been told.
Considering the basic overhead of processing the packets, sending
them, etc you start seeing delay times well under 10ms which is where
traditional sleep methods start becoming unreliable.
Anyways, based on Steve's email below, I'll definitely have to look
more closely at the AbsoluteTime based methods. Not sure if it's
hooked into the HPET or RDTSC or what, but being able to reliably
convert to current time is a big win (which is one of the big problems
of the RDTSC).
Thanks,
Aaron
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden