Doubt very many people will end up using it but it's very cool. We've been experimenting with similar concepts on hellmouth although we've currently switched to what is essentially managed timers. It works fantastically so far.
Wouldn't make a difference you're still creating new instances. Besides, the wait times aren't ment to be changed after being set.. so yeah.
Yeah, ofcourse, but what I was aiming for was if you're going to have a set of threads/timers (possibly not for CO, but for other applications as this is not CO related really), it'd be easier to manage and organize the initialization the way I suggested - both works the same just saves a couple of rows.
TimerTaskExecutor executor = new TimerTaskExecutor();
TimerTask task = new TimerTask(execute);
task.setWaitTime(2000);
executor.ExecuteTimerTask(task);
Is quite a handful.
I notice that the DateTime function is used alot too, Wouldnt it be better to use the TIME function? aka time32 which I believe is a native C++ function.
And would you like to explain why do all of what your doing when
Code:
new Thread(Core).Start();
void Core()
{
if (LastCheck.AddMili <= CurrentTime)
{
LastCheck = CurrentTime;
blabla
}
Seems smaller and easier.
However, I've tested this minorly(<-- not a word o.o) and it does appear to work and do its job with minimal resources.
Nice work, If my threading system doesnt work out its very nice to know I've got something to fall back on. +K
}
Yeah, ofcourse, but what I was aiming for was if you're going to have a set of threads/timers (possibly not for CO, but for other applications as this is not CO related really), it'd be easier to manage and organize the initialization the way I suggested - both works the same just saves a couple of rows.
Who said it is co related? However, you could easily implement this into a co environment.