You're approaching the entire problem completely wrong.
If you wish to monitor local keyboards, you use the Linux input event subsystem to read keyboard events and submit them back via uinput. See
pyinputevent for example. Using
clock_gettime(CLOCK_REALTIME,×pec) in C, or
datetime.utcnow() in Python, to measure the key down and key up events will give you very high precision timestamps you can use. The daemon will of course have to be run with elevated privileges (as
root), since normal users do not have the rights needed to access the input devices.
However, the entire idea of monitoring users' keyboards stinks to high heaven for me. Why would you want to do that?