# What timer does the return value of win.flip use?

**URL:** <https://discourse.psychopy.org/t/what-timer-does-the-return-value-of-win-flip-use/44512>\
**Category:** Coding\
**Tags:** timing\
**Created:** [April 7, 2025, 12:44pm UTC](https://discourse.psychopy.org/t/what-timer-does-the-return-value-of-win-flip-use/44512 "2025-04-07T12:44:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rdkirkden](https://avatars.discourse-cdn.com/v4/letter/r/848f3c/32.png) [@rdkirkden](https://discourse.psychopy.org/u/rdkirkden)\
**Post date:** [April 7, 2025, 12:44pm UTC](https://discourse.psychopy.org/t/what-timer-does-the-return-value-of-win-flip-use/44512/1 "2025-04-07T12:44:13Z")

</div>

I’m trying to check the latency of a TTL signal relative to flip time. The [documentation](https://www.psychopy.org/api/visual/window.html) for win.flip says that it returns “Wall-clock time in seconds”. Wall-clock time is not defined. In [this](https://discourse.psychopy.org/t/how-to-get-absolute-timing-of-keypresses/27927/3) 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?

---

<div class="post-metadata">

**Author:** ![jonathan.kominsky](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jonathan.kominsky](https://discourse.psychopy.org/u/jonathan.kominsky)\
**Post date:** [April 8, 2025, 11:22am UTC](https://discourse.psychopy.org/t/what-timer-does-the-return-value-of-win-flip-use/44512/2 "2025-04-08T11:22:24Z")

</div>

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:

```auto
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

---

<div class="post-metadata">

**Author:** ![rdkirkden](https://avatars.discourse-cdn.com/v4/letter/r/848f3c/32.png) [@rdkirkden](https://discourse.psychopy.org/u/rdkirkden)\
**Post date:** [April 9, 2025, 8:25am UTC](https://discourse.psychopy.org/t/what-timer-does-the-return-value-of-win-flip-use/44512/3 "2025-04-09T08:25:42Z")

</div>

I’m using Windows and your solution was correct, thank you!
