Hi everyone! =D
This is probably a noob question but how do I make a program run for a certain amount of time then stop? Thanks.
4 replies to this topic
#1
Posted 17 August 2012 - 03:08 PM
#2
Posted 17 August 2012 - 03:13 PM
It depends on the program running. Some cases you can just have it sleep for a certain amount of time, and os.shutdown(), other times you would need to use some timers and os.pullEvent()... What kind of program are you running? Could you post the code?
#3
Posted 17 August 2012 - 03:23 PM
Well I wanted to continuously print something for lets say 10 seconds then stop.
#4
Posted 17 August 2012 - 03:34 PM
Code:
function a()
shell.run("theprogram")
end
function b()
sleep(10)
end
parallel.waitForAny(a, :(/>/>
(This is a program to run the program "theprogram" for 10 secs)
#5
Posted 17 August 2012 - 03:37 PM
ardera, on 17 August 2012 - 03:34 PM, said:
Code:
function a()
shell.run("theprogram")
end
function b()
sleep(10)
end
parallel.waitForAny(a, :(/>/> --your code here called for "B", and we needed "b"
(This is a program to run the program "theprogram" for 10 secs)Slight correction.
3 user(s) are reading this topic
0 members, 3 guests, 0 anonymous users











