Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Timing between two canvas


OK there is something I do not understand when there is a loop, and when a canvas is drawn at every iteration.
So I tried something simple:

So I prepare a canvas, draw it and write the time of presentation of the canvas, then I sleep for 1sec.

For some reasons when I check the time difference between two consecutive canvas presentation I have really strange numbers:

Shouldnt the time there be a multiple of my refresh rate close to 1 sec?

Also I join the script I used for testing (I tried that with both psychpy and expyriment and same results).




  • Hi sylvain,

    I'm no expert, but I've been dealing with between-loop timing problems of my own, so I might be able to help...

    From the looks of your script, I would expect "Difference time_pres" to always be > 1000, since the canvas takes time to be prepared during the prepare phase, and then you sleep for 1000ms. It does seem like most of your values are pretty close 1000 + a multiple of 16.7 (refresh period at 60Hz).

    I've always noticed that the times in the logger are not quite exact multiples of my refresh period, a millisecond here and there, which I'm guessing has something to do with the time between the stimulus being drawn and the time being recorded? But, in general, I think within-trial timing in OpenSesame is way more precise and consistent than between-trial timing, owing to the front-loading of stimulus prep.

    Maybe I'm not understanding your question correctly. Are you concerned that there is so much extra time (over 1000ms) or that the extra time is not an exact multiple of your refresh rate?


  • Hi Sylvain,

    Have you tried it with xpyriment backend? You can select the backend in the main settings by clicking on "new experiment".
    If you want to have Diff time_pres to be close to 1000ms, do not use clock.sleep (1000), but clock.sleep (995).
    Also see here for timing issues


  • Hey,

    Yeah I have also tried with the xpyriment backend and it is the same.
    But I have also tried the idea of Jonathan and he is right: by staying within a loop then the accuracy is much better. I wonder if it takes too much time maybe to write on a logger or just switching from one iteration to the other.


  • Ah, now i see.
    Just put your logger at the end of the experiment. At the moment it is set into the loop. That's not the correct position.

  • Hey,

    Well the issue is that if you put it at the end you lose the information on every trial (apart from creating a list I do not see any other way to log stuffs then, but maybe there is another option I do not know?).
    OK so I tested how long it take in order to log things with the logger look and it is I think enough at least to really considerate filling list instead:

  • Hi Sylvain,

    just my two cents...

    The problem/feature is explained in detail here.

    In short, normally you want to have precise timings within sequences and don't care so much about some jitter across them. So if you bump now into a situation in which you need precise timing across s sequences, you just have to restructure your experiment so that the important stuff is run in the same phase (either prepare, or (probably), run phase). The easiest way to do that, is using inline_scripts.

    Hope this helps,


    Buy Me A Coffee

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games