Hi,
I'm working with an eyetracker that timestamps its data in seconds since the epoch (january 1st 1970). Given that the timestamp returned by the Psychtoolbox Screen('Flip') function returns the number of seconds since system startup, I thought that I would convert the system start time to UTC and increment it by the time value returned by Screen('Flip') to timestamp the onset and offset of stimuli and know where the data corresponding to these events is in the eyetracker recording. However, I've noticed that over numerous iterations, the values returned by this method slowly, but surely drift apart from the values obtained by java.lang.System.currentTimeMillis, which returns the number of milliseconds since the epoch, but doesn't have the resolution needed for my purposes.
1- Which timer is in error?
2- How do I correct for this time drift?
I'm working with an eyetracker that timestamps its data in seconds since the epoch (january 1st 1970). Given that the timestamp returned by the Psychtoolbox Screen('Flip') function returns the number of seconds since system startup, I thought that I would convert the system start time to UTC and increment it by the time value returned by Screen('Flip') to timestamp the onset and offset of stimuli and know where the data corresponding to these events is in the eyetracker recording. However, I've noticed that over numerous iterations, the values returned by this method slowly, but surely drift apart from the values obtained by java.lang.System.currentTimeMillis, which returns the number of milliseconds since the epoch, but doesn't have the resolution needed for my purposes.
1- Which timer is in error?
2- How do I correct for this time drift?