reading the system clock value?

偶尔善良 提交于 2019-12-11 20:43:48

问题


Is there a virtual/system clock running independently when a computer is booted?

How can we read that value?


回答1:


Use the RDTSC x86 instruction, it reads the clocks since the system-start.

Edit: On x86-64 targets the use of inline assembly is not possible anymore, use either intrinics or a external linked object file which was generated by an assembler. Do not forget to flush the processor pipeline before using this instruction.



来源:https://stackoverflow.com/questions/3253387/reading-the-system-clock-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!