Get time in 1 ms increments

The x86 0x1A interrupt seems to give the computer uptime, but it can only give the exact time within 55 ms (AH = 0). Is there a way to get smaller increments (and maybe a little more "normal") than this, for example, 1 ms? I am trying to create my own toy, so I cannot use anything that I cannot write myself.

+5
source share
2 answers

Since you are creating your own OS, you do not need to save a timer period. You can reprogram the PIT to activate INT 8 (IRQ 0) more often. See here .

On new computers, you can also use the High Precision Event Timer .

+3

rdtsc ( ) x86, 64- edx:eax. , , . - , 1 .

rdtsc:

  • . .
  • . .
  • reset.

, .

+6

All Articles