Howdy, Stranger!

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

Supported by

Adding a time variable to be displayed in the data file?

edited March 2016 in OpenSesame

I would like to add a time variable or time stamp that corresponds to the computer's time in the data file that is
produced when running an experiment. My research team and I want to sync the time on a camera with the time on the computer, so that if something goes wrong we can accurately eliminate data from a specific time in the running experiment. Basically, I want to record the actual time certain things happen when running a file. Can I add a time variable/ stamp in the data file that won't interfere with the actual background and participant's response time of the experiment. I would appreciate any help on how I can actually implement this in my experiment. Thank You.

Comments

  • edited 6:20AM

    Hi Diane,

    If the timing precision does not require subsecond timestamps you could use the datetime module. In order to do so, place an inline_script on every position in your experiment tree where you want to check the time.

    In the run phase of the script write:

    import datetime
    
    # Create a variable for your timestamp
    var.timeA = datetime.time()
    

    And in your logger item manually add the created variable to write the time along with the rest of the data.

    The timestamp looks like 03/27/16 16:06:15 but you can alter the format by using datetime.strftime(). For more info check:

    I hope this helps!

    Laurent

  • edited 6:20AM

    Hi Laurent,

    Thank you so much for replying and giving me some help. I implemented your idea and I was able to get the timeA variable to show up on my data file. However, it doesn't seem to be recording the actual date or time. In the data it shows 0:00 for all the times variable timeA is logged. Is there any other settings I need to change? Can you help me figure out why it won't actually record a date and time?

    Regards,
    Diane

  • edited 6:20AM

    Hi Diane,

    My apologies, i should've checked it before responding. Instead of the local time, i think it measured the time between to points, which is 0:00 if there is only one timestamp.

    As an alternative you can use this:

    # Import the time module
    import time
    
    # Create formatted timestamp, include "%d %b %y" 
    # before the time notation if you want the full date
    var.timeA = time.strftime("%H:%M:%S", time.localtime())
    

    The logger should include the variable automatically, if not, manually add it.

    Let me know if it works!

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 http://45.77.173.118/ 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