Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

INFO: Ultra High Precision Timer

bikibiki Member Posts: 492
[green]
This relates to Intel CPUs. Other brands probably have a similar instruction?

Pentium CPUs have a instruction called "RDTSC" which gives accuracy you a precise measurement - at the speed of the CPU. So, if you have a 500 MHz CPU, you get a frequency of 500 MHz. Thats 500,000,000 clock ticks per second, which is a 0.000000002 ms.

Link: http://www.hussar.demon.co.uk/mathszon.htm#Ultimate System Timer by Jason M McGuiness

Cheers!
-Bikram
[/green]

[hr];-) [b][size=4][red]~Bikram[/red][/size][/b]

Comments

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : [green]
    : This relates to Intel CPUs. Other brands probably have a similar instruction?
    :
    : Pentium CPUs have a instruction called "RDTSC" which gives accuracy you a precise measurement - at the speed of the CPU. So, if you have a 500 MHz CPU, you get a frequency of 500 MHz. Thats 500,000,000 clock ticks per second, which is a 0.000000002 ms.
    :
    : Link: http://www.hussar.demon.co.uk/mathszon.htm#Ultimate System Timer by Jason M McGuiness
    :
    : Cheers!
    : -Bikram
    : [/green]
    :
    : [hr];-) [b][size=4][red]~Bikram[/red][/size][/b]
    :
    [blue]The accuracy of this instruction will be affected (much affected) with the cache performance, unaligned code and data and other factors. The absolute 1 clocl accuracy will never be achieved, but you can definitely use it to see which code runs faster or slower, but also, you have to perform a lot of measurements and take an average.[/blue]
  • bikibiki Member Posts: 492
    The accuracy of this instruction will be affected (much affected) with the cache performance, unaligned code and data and other factors. The absolute 1 clocl accuracy will never be achieved, but you can definitely use it to see which code runs faster or slower, but also, you have to perform a lot of measurements and take an average.[/blue]
    :

    [green]
    I dont think you are correct. The timer is unaffected by such things. Ofcourse, if you are quoting from an authoratative source, then I must ask, which one?[/green]
    [hr];-) [b][size=4][red]~Bikram[/red][/size][/b]

Sign In or Register to comment.