I'm trying to make a timer which is a reusable module. Is this possible? I would like to pass 1 argument to the timer. The argument is the delay that the main program waits before it continues.
The main program would be something like
start
do something (process 1)
pass argument ( delay time eg 2 sec) to timer
after timer has timed out program continues
do something (process 2)
pass argument ( delay time eg 1 sec) to timer
after timer has timed out program continues
do something (process 3)
pass argument ( delay time eg 4 sec) to timer
after timer has timed out program continues
do something (process 4)
pass argument ( delay time eg 0.5 sec) to timer
after timer has timed out program continues
end
As you can see 1 timer is used to provide repeatedly delays to the program by varying amounts of time. I cant stop the thread because other inputs are received when the timer has delayed the program and still have to be acted upon.
Ive looked around but I cant find anything close to what Im trying to do.
Any ideas or pointers?
The main program would be something like
start
do something (process 1)
pass argument ( delay time eg 2 sec) to timer
after timer has timed out program continues
do something (process 2)
pass argument ( delay time eg 1 sec) to timer
after timer has timed out program continues
do something (process 3)
pass argument ( delay time eg 4 sec) to timer
after timer has timed out program continues
do something (process 4)
pass argument ( delay time eg 0.5 sec) to timer
after timer has timed out program continues
end
As you can see 1 timer is used to provide repeatedly delays to the program by varying amounts of time. I cant stop the thread because other inputs are received when the timer has delayed the program and still have to be acted upon.
Ive looked around but I cant find anything close to what Im trying to do.
Any ideas or pointers?
Comment