Howdy, Stranger!

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

Supported by

Delay in sketchpad display in Loop


I'm building an experiment with Open sesame. In this experiment, I would like to display one stimulus (a circle or a square) every 500ms. I would like display 20 stimuli. The participant have to determine if the stimulus is a circle (to press "S" key) or a square (to press "L" key).

The localization of the stimulus on the screen is random and the alternating between square and circle is also random. For this, I created a loop. Each row is the name of the stimulus (circle/square), a x position, and a y position. The order of the loop is "random".

Next, I added a sketchpad which displays the stimuli according to the values of variables in the loop. Finally, the function keyboard.get_key( ) to record the responses.

Because I would like to display 20 stimuli (one by one), my loop iterates 20 times (until the count_variable = 20). So, the total time of this display must be 10 s (20 stimuli * 500 ms). However, this display runs late (12s instead of 10s). I don't understand why. Can you help me to reduce this late?

You could find tattached this opensesame projet (Distracteur_display.osexp).

I tried to not use "sketchpad" but canvas or form (with inline script python) but the issue is the same.

I tried to use letter instead of square/circle but the issue is the same.

I verified to correctly use "prepare" for the keyboard.

Thanks you for your help!

NB: I'm using the backend "PsychoPy, powerful stimulusgeneration"


  • Hi,

    Are you sure this has nothing to do with your machine? When I run your code, I get:

    which is pretty accurate I guess?


    Buy Me A Coffee

  • Hi,

    Thanks for your answer.

    Indeed, the time of each keyboard seems to be accurate. However, when I compute the total time for the display of all stimuli, I find a delay, namely :

    • For 20 stimuli: 12s instead of 10s
    • For 60 stimuli: 36s instead of 30s.

    I find this delay when I compute the total time with the clock.time( ) function in Opensesame and when I compute the total time with an external timer.

    I'm adding a new opensesame file with the calculation of this time (which reveals this delay - var.total_time).


  • Hi Inès,

    That's quite normal. Opensesame is optimized so that timing within a trial is as precise as possible, where "within" a trial is defined as the elements in the run phase of a sequence. It does so by sacrificing a bit of accuracy across trials, so between two iterations of a sequence. If you need more detail, you can read again the prepare-run-strategy part of the documentation.

    So avoid the 2 or 6 seconds delay across trials, you can implement your own trial structure, based on inline_scripting. Attached you find an example that demonstrates the idea, the timing is much better already. There is of course still room for improvement (mostly due to the overhead of managing the different phases, which you can avoid, by not using loop-sequence in first place), but I wouldn't worry too much about that little delay.


    Buy Me A Coffee

  • Hi,

    Thank you very much for your help!

    It was very usefull and it helped me to better understand!


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