Mail Archives: djgpp/2001/01/18/11:51:34
it does not really matter. you know why? because the only thing we want is
having that value from RDTSC after a certain period of time. it doesn't
matter what CPU does meanwhile (messes with kernel code or user task or with
the stack you meantion). and even if you talk about the overhead, this
overhead simply shifts everything in time (e.g. adds the same constant value
to the value from RDTSC). and when we compute the difference this "overhead"
disappears. do you care about value of (say) (5-2) more than about value of
(7-4)???
btw, if there was something like that overhead, it would have less
contribution to the measured frequency rather than contribution of timer
accuracy and BIOS code which increments the counter at 40h:6ch.
--
Alexei A. Frounze
alexfru [AT] chat [DOT] ru
frounze [AT] ece [DOT] rochester [DOT] edu
http://alexfru.chat.ru
http://members.xoom.com/alexfru/
http://welcome.to/pmode/
"Tom St Denis" <stdenis AT compmore DOT net> wrote in message
news:946ofe$vlp$1 AT nnrp1 DOT deja DOT com...
> In article <945mn8$cjroo$1 AT ID-57378 DOT news DOT dfncis DOT de>,
> "Alexei A. Frounze" <dummy_addressee AT hotmail DOT com> wrote:
> > "Tom St Denis" <stdenis AT compmore DOT net> wrote in message
> > news:945itn$3ai$1 AT nnrp1 DOT deja DOT com...
> > > In article <945a90$ckgq1$1 AT ID-57378 DOT news DOT dfncis DOT de>,
> > > "Alexei A. Frounze" <dummy_addressee AT hotmail DOT com> wrote:
> > > > right, you can use RDTSC for getting CPU speed. But RDTSC can be
> > disabled in
> > > > user mode (e.g. Privilege Level 3) by an OS.
> > > > for instance, the following code works fine on my Celeron566 imder
winME
> > and
> > > > gives 564-566MHz:
> > >
> > > Works somewhat cool, I got 807Mhz on my 800Mhz TBird Athlon.
> >
> > Glad to hear that a program I made in around 15 mins, works for you too.
:)
>
> You should calc for the stack overhead. I.e do something like
>
> mov ebp,128
> l1:
> rdtsc
> push eax
> push edx
> rdtsc
> pop eax
> pop edx
> add ebx,eax
> adc ecx,edx
> dec ebp
> jnz l1:
> shrd ebx,ecx,7
>
> (overhead in ecx::ebx)
>
> Tom
>
>
> Sent via Deja.com
> http://www.deja.com/
- Raw text -