如何使用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 联系我们: