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
Well, there are:
嗯,有:
clock_gettime
, nanosecond-resolution, often good enough for everything.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。