Shoutbox

[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?
Will use too much memory or slow down the system?

I really don't know how much memory it will require and if MsgPlus Timer is a great memory consumer...

Thanks a lot one more time!


RE: [Question] Timer usage by Jimbo on 01-08-2007 at 08:57 PM

quote:
Originally posted by tryxter
What do you think of a timer being executed every 1 minutes?
Will use too much memory or slow down the system?

I really don't know how much memory it will require and if MsgPlus Timer is a great memory consumer...

Thanks a lot one more time!
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 ;)

Thanks a lot


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:
Originally posted by CookieRevised
tryxter, what do you want to do with the timer?

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 :p)
RE: RE: [Question] Timer usage by CookieRevised on 01-08-2007 at 11:40 PM

quote:
Originally posted by tryxter
quote:
Originally posted by CookieRevised
tryxter, what do you want to do with the timer?
The objective is to search some text inside an ini file, and output that text.
Ok... but what have timers to do with this?

quote:
Originally posted by tryxter
(Ok, I found the edit option :p)
cool :D
RE: [Question] Timer usage by tryxter on 01-08-2007 at 11:51 PM

quote:
Originally posted by CookieRevised
Ok... but what have timers to do with this?
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:
Originally posted by CookieRevised
cool :D
lol :p
RE: RE: [Question] Timer usage by CookieRevised on 01-08-2007 at 11:57 PM

quote:
Originally posted by tryxter
quote:
Originally posted by CookieRevised
Ok... but what have timers to do with this?
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).
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.

The time interval will be 1min, that should be enough, to do what I want.

Do you think it will consume too much memory/slow down the system?

Off topic:
How can I declare a multidimensional array? like array[x][y]?
I tried "var xyz = new array(,)" and "new array([],[])" but it seems that isn't working...

I've already tried to read some reference but it's kind of messy on that part.

Thanks a lot for all your help :)


RE: RE: [Question] Timer usage by CookieRevised on 01-11-2007 at 06:24 PM

quote:
Originally posted by tryxter
I forgot to say: on script starting, all the text is loaded to arrays (by times). Just like you said me to do.

The time interval will be 1min, that should be enough, to do what I want.

Do you think it will consume too much memory/slow down the system?
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:
Originally posted by tryxter
Off topic:
How can I declare a multidimensional array? like array[x][y]?
[split] multi-dimensional arrays