Millisecond Forums

Abort script after certain amount of time

https://forums.millisecond.com/Topic27821.aspx

By SabRV - 9/24/2019

Hi all,

Question: I want my script to be aborted after 25 min. I can only find commands on how to abort on conditions of responses etc. Does anyone have a command for this?

Thanks in advance!
Best,
Sabrina
By Dave - 9/24/2019

SabRV - 9/25/2019
Hi all,

Question: I want my script to be aborted after 25 min. I can only find commands on how to abort on conditions of responses etc. Does anyone have a command for this?

Thanks in advance!
Best,
Sabrina

The script.elapsedtime property gives you the amount of time elapsed (in milliseconds) since the start of script execution, so you can do something like this

/ ontrialend = [ if (script.elapsedtime >= 1500000) script.abort();]
By SabRV - 9/24/2019

Dave - 9/25/2019
SabRV - 9/25/2019
Hi all,

Question: I want my script to be aborted after 25 min. I can only find commands on how to abort on conditions of responses etc. Does anyone have a command for this?

Thanks in advance!
Best,
Sabrina

The script.elapsedtime property gives you the amount of time elapsed (in millisecond) since the start of script execution, so you can do something like this

/ ontrialend = [ if (script.elapsedtime >= 1500000) script.abort();]

Awesome Dave, thank you!!