You should either:
* have a timer triggering interrupt that reads the data
* have a timer triggering DMA from the input port (if it was whole 8/16 bit) directly to memory
* trigger an interrupt with microprocessor's clock bus and read it directly.
Technically the 2nd one should have zero jitter (aside from clock itself).
Busy loop is the worst case on a microprocessor running RTOS to do the other stuff.