How can I make an event fire every 30 minutes? [RESOLVED]
I believe timers and thread.sleep is for short durations, like under 3 minutes?
How could I control timing of an event to occur after a half hour?
I have never used date/time and am wondering if this is what I should play with to do something like this?
Re: How can I make an event fire every 30 minutes?
Use a timer but declare a static variable to be a counter. increment your counter every
5 mins then when it reaches 30 mins do your stuff.
Re: How can I make an event fire every 30 minutes?
Ah, so timers can last longer. What is a timers limit in length? 5 Minutes?
Re: How can I make an event fire every 30 minutes?
Actually in .NET timer interval is an Integer so it can hold a value of 2,147,483,647. Sorry I was thinking still in VB6.
Re: How can I make an event fire every 30 minutes?
Does that mean over 2 hours? Is that right the way I am reading that?
Re: How can I make an event fire every 30 minutes?
I think this is how it goes?
2147483647 / 1000 = 2147483.647 = seconds
2147483.647 / 60 = 35791.394116666666666666666666667 = minutes
35791.394116666666666666666666667 / 60 = 596.52323527777777777777777777767 = hours
596.52323527777777777777777777767 / 24 = 24.855134803240740740740740740733 Days ???
Re: How can I make an event fire every 30 minutes?
Thats an insane amount of time for an interval.
I entered 2147483648 for an interval and it errored out, but it ran fine for 2147483647.
Re: How can I make an event fire every 30 minutes?
Thnx so much, that means I can just use a timer. Cool, I've done that before!
Woohoo!
And o ya, I forgot about the 60. Thanks for the info!
Re: How can I make an event fire every 30 minutes? [RESOLVED]
No prob. I knew they increased the Integer to a Long in .NET but it never clicked with me that
the Interval would relate to a Long too :lol:
Glad to have helped. :thumb:
Re: How can I make an event fire every 30 minutes? [RESOLVED]
Ugh, how do u multiply something on a line?
Like
VB Code:
tmrLoadPge.Interval = 60000 x timerVariable
Can it be done that way?
timerVariable is a variable that holds how many minutes I want to change to.
60000 is of course 1 minute multiplied to it.
Re: How can I make an event fire every 30 minutes?
VB Code:
tmrLoadPge.Interval = 60000 [b]*[/b] timerVariable
:D
Assuming that your var contains a numeric value.
Re: How can I make an event fire every 30 minutes?
Thank you, I had just realized what I was doing wrong; x looks like a variable I am sure. It's *.
Thanks again.