Timestamps using globalClock code not accurately timing mic start

I have an experiment where I use a code component to start a microphone (I wanted to run the mic as a thread so there is only 1 recording)

I want to timestamp the start of the microphone, I use the globalClock.getTime() code to timestamp this, however after testing, I consistently find that this timestamp is not accurate, as it seems that the mic recording starts after my timestamp.

It is absolutely essential that my timestamp for this is accurate, can someone help me with how I can timestamp this accurately?

Thank you