how to add max time that the script can run within

Support
  • I want to run my script only for 10 minutes and if it does not get complete within that time it should automatically close itself is it possible to do I remember there was some feature for this but I cannot find it in someone please help

  • Well, I have never done it, but you can try this approach:

    1. Run a background function to check the execution time of your script.
    2. After the specified time has elapsed, the function can perform a task such as closing the script or any other action you desire.
  • @sergerdn okay you tell me a little more about how to run a background function I have never done that before do you mean the asynchronous feature

    I understand your approach just need little help on how I can run a background function
    thanks for the help much appreciated :)

  • @Bunnz said in how to add max time that the script can run within:

    @sergerdn okay you tell me a little more about how to run a background function I have never done that before do you mean the asynchronous feature.

    Yeah.

    I understand your approach just need little help on how I can run a background function
    thanks for the help much appreciated :)

    I believe you should consult the BAS documentation on how to make it work.

  • @sergerdn hi could you please point me towards a documentation for this feature or maybe like a post that discuss about background function I tried to the best of my abilities to find something related to that but could not find anything

    if I understand everything correctly what you mean I need to run a background function basically a script inside a script to check the time and when that is done I should end my script right I think I can do that on my own but I just need help on figureing out the background function thing how I can run a background function while my rest of the script is also running

  • @sergerdn I have figured out that we can do this in a asynchronised feature but for me I cannot figure out how to get it to work I have made a separate function and put that inside the a asynchronise feature but instead of starting that function and then continuing with the rest of my script it just goes to that function and wait for that function to get completed

    how can I do it so that it does the function inside a asynchronise feature but also continues with my script at the same time instead of waiting for asynchronous function to get complete