Scripts / Need help with a polling timer.

Author
Message
!nullptr
Forum Support
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 17th Apr 2015 22:40 Edited at: 17th Apr 2015 23:08
I'm trying to run multiple timers in a project. I call poll_timer(n) and I get a trigger when n has elapsed. It works fine except where 2 scripts that use it have overlapping range. If I place the script at the bottom of each calling script it works fine and I've had 3 timers all running with different n values with no issue. An easy enough workround but inefficient, obviously.

In the tradition of a pedantic and perfectionist coder I know I can do better so quite some time was spent trying to get some kind of indexing array happening so I could call with poll_timer(index,n) but after 4 hours my eyes are glassed over and my head is done in.

I need a single function with multiple call ability with concurrent overlap.

How would you do it? I'm almost in quit mode and will settle for the workround

Can you help me Obiwan?



edited typos
Development/ Gaming Rigs
Sys 1: i7-4770 (3.5)/16Gb/128 SSD/3Tb/970gtx/2 x 23, 1 x 27 LCD - Sys 2: i7/8Gb/670gtx/1.5Tb/1 x 23 LCD - Sys 3: Amd Quad/8Gb/645gtx/1Tb/30" LCD
PM

Login to post a reply

Server time is: 2024-12-21 13:39:57
Your offset time is: 2024-12-21 13:39:57