[Question] Timer usage - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4) +---- Forum: Scripting (/forumdisplay.php?fid=39) +----- Thread: [Question] Timer usage (/showthread.php?tid=70478) [Question] Timer usage by tryxter on 01-08-2007 at 08:56 PM
What do you think of a timer being executed every 1 minutes? RE: [Question] Timer usage by Jimbo on 01-08-2007 at 08:57 PM
quote:Every one minute would take a lot of mem usage. I recomend once every 4 or 5 minutes RE: [Question] Timer usage by tryxter on 01-08-2007 at 08:59 PM
Ok RE: [Question] Timer usage by matty on 01-08-2007 at 09:00 PM I have a specific function of Screenshot Sender 4 being 100 miliseconds. Its not really that much of an issue. RE: [Question] Timer usage by CookieRevised on 01-08-2007 at 09:27 PM tryxter, what do you want to do with the timer? RE: RE: [Question] Timer usage by deAd on 01-08-2007 at 09:59 PM Timers don't take up a lot of memory at all. RE: [Question] Timer usage by tryxter on 01-08-2007 at 11:13 PM
quote: The objective is to search some text inside an ini file, and output that text. Btw, I tested the memory consume using 5 secs timers, and I didn't notice any change at all, but I don't know if that change was visible... (Ok, I found the edit option ) RE: RE: [Question] Timer usage by CookieRevised on 01-08-2007 at 11:40 PM
quote:Ok... but what have timers to do with this? quote:cool RE: [Question] Timer usage by tryxter on 01-08-2007 at 11:51 PM
quote:Oh, well, the text read from the file has dates and times. When the timer is triggered it will read the ini file and will look for a time (that should correspond to the current time), and if this action returns 'true', it will do something (like display a toast or something, not decided yet). quote:lol RE: RE: [Question] Timer usage by CookieRevised on 01-08-2007 at 11:57 PM
quote:Why not make your schedular the other way around so you avoid intensive file read operations all the time: Read the file only when you script starts and store everything in memory. Make a timer which fires every time interval (smallest amount defined in your alarms in the ini, I assume it would be 1000ms) and compare the current time with the time in memory, if it is the same or higher, fire the event. RE: [Question] Timer usage by tryxter on 01-09-2007 at 12:18 AM
I forgot to say: on script starting, all the text is loaded to arrays (by times). Just like you said me to do. RE: RE: [Question] Timer usage by CookieRevised on 01-11-2007 at 06:24 PM
quote:No. The things that would slow down the system most is the reading of the file. But since you do that once at the start of the script or when user logs in, this shouldn't be a problem. quote:[split] multi-dimensional arrays |