Rod Pemberton said:
You've asked me that twice in the past. I answered twice. Try to
remember.
Sorry, I've forgotten. A Google Groups search indicates that you've
discussed the rdtsc instruction here before; apparently I didn't find
any of those discussions very memorable.
You'll want some GCC code (similar) to this:
[snip]
I seriously doubt it.
And, one again you show your abundant ignorance of anything
immediately outside the boundaries of the C specification...
If it's outside the boundaries of the C specification, it's off-topic
for this newsgroup. I admit that I don't know much about x86 assembly
language. That's why I don't post to comp.lang.asm.x86.
In any case, if I understand the code you posted correctly, it uses
the rdtsc instruction to load the value of the system's high
resolution time-stamp counter. The original poster was looking for a
high-resolution timer that would send his program a signal after a
specific timeout. Your code does nothing like that. You've provided
a chunk of code that (a) is entirely off-topic in this newsgroup, (b)
is extremely system-specific (and compiler-specific), and (c) doesn't
even address what the OP was asking about.
To the original poster: There is no way to do what you're trying to do
in portable C. There most likely is a system-specific way to do it,
*without* resorting to assembly language. I suggest that the
system-specific "setitimer" function might or might not be a good
starting point. (I make no specific claims about that; I've never
used it myself, and it's off-topic here.) Consult your system's
documentation. If you have any further questions, please post to
comp.unix.programmer.