pvaju896
pvaju896

Reputation: 1417

reading the system clock value?

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

How can we read that value?

Upvotes: 1

Views: 1302

Answers (1)

Quonux
Quonux

Reputation: 2991

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.

Upvotes: 4

Related Questions