GetSecs time drift issue

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?
assuming that you are running separate tracker and stimulus machines, then most likely the system clocks of the two machines are running at slightly different speeds. if they are definitely drifting then you should store synchronisation information so you can adjust for the drift...

what kind of tracker are you using?
Thank you for your reply.

The eyetracker I'm using is a FaceLAB 5 eyetracker. The problem I'm documenting isn't two machines growing out of sync, but rather two different time measurements within Matlab drifting apart: one obtained with java.lang.System.currentTimeMillis, and the other obtained by estimating the system startup time in UTC time since the epoch and incrementing it with the time elapsed measurements obtained with GetSecs, which is what Screen('Flip') uses to record timestamps: the latter method is a wee bit slower than the former. The problem with java.lang.System.currentTimeMillis is that it only has a time resolution of about 15 ms and I'd like to have something that's ideally under 1 ms.