I’m trying to check the latency of a TTL signal relative to flip time. The documentation for win.flip says that it returns “Wall-clock time in seconds”. Wall-clock time is not defined. In this forum post, it says that wall clock time can be obtained by importing the “time” module and using the command “time.time()”. However, I have found that this timestamp has a very different value from the return value of win.flip, e.g. 1744026918.5061774 versus 1.7810989000136033. Is it possible to get a timestamp (for the TTL event) that uses the same timer as the return value of win.flip?
Mac or Windows? I only ask because the flip timing on mac is a bit weird right now.
“Wall-clock time in seconds” is indeed vague. Looking at the actual code the relevant function is this:
logging.defaultClock.getTime()
Digging into the logging code, that’s a clock.monotonicClock
object that starts when the window opens initially. So I think time.time()
is giving you “seconds since 1970” (i.e., “epoch time” or “Unix time”) while win.flip()
is giving you “Time since the window opened”.
If you want to get the same clock for the TTL event, I think you can call logging.defaultClock.getTime()
directly in your code as long as you have imported psychopy.logging
I’m using Windows and your solution was correct, thank you!