如何使用linux获取时钟周期的值?

[英]How to get the value of clock cycles in ticks using linux?


Taking the timestamp in linux is same as clock cycles in ticks for linux. I know how to get the timestamp but I dont now how to take the clock cycles in ticks. could someone tell me what is the difference between the two ?? could someone give me a small example for clock cycles in ticks ??

采用linux中的时间戳与linux中的时钟周期相同。我知道如何获取时间戳,但我现在不知道如何以时钟周期为单位。谁能告诉我两者有什么区别?有人可以给我一个小时钟周期的例子吗?

Looking forward for your reply.

期待您的回复。

extra : Am trying to add assembly instructions for timing in pisa architecture using simplescalar simulator. For my instructions i should access clock cycles and store it in the register.

额外:我试图使用simplescalar模拟器在比萨架构中添加组装指令。根据我的指示,我应该访问时钟周期并将其存储在寄存器中。

1 个解决方案

#1


1  

Well, there are:

嗯,有:

  1. Ticks. Modern kernels don't use them.
  2. 蜱。现代内核不使用它们。
  3. Timestamp counter, this is what you may like to use for high-resolution time measurements, but you have to understand how to make unbiased measurements with it.
  4. 时间戳计数器,这是您可能希望用于高分辨率时间测量,但您必须了解如何使用它进行无偏差测量。
  5. Clocks, portable clock_gettime, nanosecond-resolution, often good enough for everything.
  6. 时钟,便携式clock_gettime,纳秒分辨率,通常足以满足一切要求。

If you want to get access to CPU performance registers, you can start with Intel® Performance Counter Monitor inside your programs.

如果要访问CPU性能寄存器,可以从程序内部的英特尔®性能计数器监视器开始。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2014/06/10/309321978110a867ad09685419e72bea.html



 
  © 2014-2022 ITdaan.com 联系我们: