Re: Accessing tick counter without api

From: Tim Roberts (spamtrap_at_crayne.org)
Date: 09/13/04


Date: Mon, 13 Sep 2004 03:58:45 +0000 (UTC)

Robert Redelmeier <redelm@ev1.net.invalid> wrote:
>Paradox <spamtrap@crayne.org> wrote:
>> Hey i'm making a 32bit windows dialog application and
>> i dont want to use the GetTickCount api I was thinking
>> there would be a place in memory which i could find and
>> just access the tick count via memory, is this possible?
>
>I think you've already had replies about this. Since this
>is an ASM newsgroup, I have a lower level possibility:
>
>Why not use the `rdtsc` instruction to read the Time-Stamp
>Counter? Scale & offset to ticks if needed.

That "scale & offset" operation is not necessarily trivial, because it
isn't always obvious how to determine cycles per second. That's especially
true on the modern processors that "downshift" at unexpected times.

-- 
- Tim Roberts, timr@probo.com
  Providenza & Boekelheide, Inc.


Relevant Pages

  • dynamic allocation file buffer
    ... between concurrently running programs (IPC / shared memory). ... and does not offer persistence, ... a program can acquire the offset of an unused block of a ... Node: tag: b ...
    (comp.lang.python)
  • Re: dynamic allocation file buffer
    ... between concurrently running programs (IPC / shared memory). ... and does not offer persistence, ... a program can acquire the offset of an unused block of a ... Node: tag: b ...
    (comp.lang.python)
  • Re: Decoding strategy
    ... The virtual memory range is not reserved until you call ... MapViewOfFile. ... My point is that the amount of data in physical RAM will be related to your ... file offset currently being mapped. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: The variable bit cpu
    ... > However looking at the big picture the effort to scale fixed bit hardware ... those bits are kept in the opcode rather than in each memory ... And while a *few* applications might need to scale beyond 256 bits, ... And one *big* thing you're missing here is that have a variable-bit ...
    (alt.lang.asm)
  • How to use "offset" parameter in mmap() system call
    ... I wrote a device driver, it supports mmap(), but I met some ... How to use the offset parameter of mmapcorrectly? ... My driver is a char device driver, when it is loaded, it allocates ... 64 MB contiguous physical memory using contigmalloc, ...
    (freebsd-hackers)