Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Specify how long you want the trial the last. Make sure that trials do not last
- # longer!
- trial_duration = 3000
- # Get a trial id
- trial_id = self.get_check('trial_id', default=0)
- # For the first trial, just note the time
- if trial_id == 0:
- exp.set('first_trial_timestamp', self.time())
- time_to_pad = 0
- # For the other trials, wait until the the trial should start, based on the time
- # of the first trial and the trial duration
- else:
- time_to_pad = self.get('first_trial_timestamp') + trial_id * trial_duration - self.time()
- if time_to_pad > 0:
- self.sleep(time_to_pad)
- # Remember the trial id and padding time
- exp.set('trial_id', trial_id+1)
- exp.set('time_to_pad', time_to_pad)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement