Le 23/03/2013 19:43, dr.diesel a écrit :
> I'm looking to trigger an event at midnight, any suggestions on the best
> method to ensure the time is not missed?
>
> My application reads/writes a DB, launches websites and reads heavily on the
> COM port.  I'm afraid that if I simply look for the date/time to be 00:00
> I'll miss the time while some other event is happening.  Do I need to just
> carefully code this or is there some other method I'm not seeing?
>
> Many thanks
> Andy
>

Check the time with two timers.

For example, the first timer will be raised for example each hour. And 
when it is past 23:00, start another timer with a more precise 
resolution to check when midnight is reached.

You can use more timers. It depends on which precision you need.

But beware that there is only one thread in Gambas, so a too long event 
handler prevents other events to be raised.

Regards,

-- 
Benoît Minisini

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to