Events at Midnight

  • Thread starter Thread starter Giulio Petrucci
  • Start date Start date
G

Giulio Petrucci

Hi there,

I need my application to be notified when it's midnight. How can I do
it? (Someone suggested me to use a timer rising an event every
minute...please, telle me there is some other way!).

Thanks in advance,
Giulio
 
I need my application to be notified when it's midnight. How can I do it?
(Someone suggested me to use a timer rising an event every
minute...please, telle me there is some other way!).


That's certainly the way I would do it...

What issue do you have with this...?
 
Hi there,

I need my application to be notified when it's midnight. How can I do
it? (Someone suggested me to use a timer rising an event every
minute...please, telle me there is some other way!).

Thanks in advance,
Giulio

When you application is started, you could calculate remaining
milliseconds until midnight, and then start a timer with that
calculated value.
 
Hi Mark,

Mark Rae ha scritto:
What issue do you have with this...?

The idea to have a timer polling every minute sounds a bit "stressing"
to me... ;-)
But, really, nothing bad with this approach... I was just hoping there
was some system to "hook" the System clock.

Thanks,
Giulio
 
Giulio Petrucci said:
Hi there,

I need my application to be notified when it's midnight. How can I do it?
(Someone suggested me to use a timer rising an event every
minute...please, telle me there is some other way!).

Thanks in advance,
Giulio


Has your application anything else to do while waiting for midnight? If not,
just schedule your application to get started at midnight using the system
scheduler.

Willy.
 
I have implemented several of these type of applications to run throughout
the night. I setup Scheduler with a series of Scheduled tasks and it runs
all the reports and then places them on a network drive for access by
everyone who needs them, and even emails them to alert them that the reports
are now there.

Ron
 
The idea to have a timer polling every minute sounds a bit "stressing" to
me... ;-)
Why...?

But, really, nothing bad with this approach... I was just hoping there was
some system to "hook" the System clock.

There is - it's called a Timer... :-)
 
Giulio Petrucci said:
Hi Mark,

The idea to have a timer polling every minute sounds a bit "stressing" to
me... ;-)

The OS is constantly polling things. All things that are clock-based are on
a poll-for-time basis. Even if the OS offered a time-based hook, internally
it would be a poll-for-time implementation.

Jon
 
Jon Davis said:
The OS is constantly polling things. All things that are clock-based are
on a poll-for-time basis. Even if the OS offered a time-based hook,
internally it would be a poll-for-time implementation.

Jon

Could you set up a Scheduled Task to simply run the program at midnight?
 
Back
Top