473,396 Members | 1,894 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

date/time elapsed event

Hi,

I'm looking for a better way to do a date/time elapsed event rather
than a timer elapsed event.

Currently, I wrote my program to use a timer elapsed event set to 1
second, and it checks the date/time in the event. Is there a better
way?
Thanks.
Jan 2 '08 #1
7 2216
It all depends on what your task needs to achieve.

If you explain that, then you are likely to get the appropriate advice.
"wanwan" <er*******@yahoo.comwrote in message
news:63**********************************@e25g2000 prg.googlegroups.com...
Hi,

I'm looking for a better way to do a date/time elapsed event rather
than a timer elapsed event.

Currently, I wrote my program to use a timer elapsed event set to 1
second, and it checks the date/time in the event. Is there a better
way?
Thanks.
Jan 2 '08 #2
On Jan 2, 6:21 pm, "Stephany Young" <noone@localhostwrote:
It all depends on what your task needs to achieve.

If you explain that, then you are likely to get the appropriate advice.

"wanwan" <ericwa...@yahoo.comwrote in message

news:63**********************************@e25g2000 prg.googlegroups.com...
Hi,
I'm looking for a better way to do a date/time elapsed event rather
than a timer elapsed event.
Currently, I wrote my program to use a timer elapsed event set to 1
second, and it checks the date/time in the event. Is there a better
way?
Thanks.
my program allows setting actions running as one time events or
recurrent events(weekly, monthly ...). I think my current approach
(i.e. using one second timer) is very inefficient because there is no
need to do the check so frequently.

I need to know if there is anything in vb.net I can use where the
event is triggered by date and time.

Thanks.
Jan 3 '08 #3
Whatever you do, don't equate 'doing something frequently' with
'inefficient'.

Computers are designed to handle 'doing something frequently'. In fact
various parts of your computer are doing things 100's and even 1000's of
times every second.

Efficiency is more likely to be affected by what happens rather that how
often it happens.

The first thing you have to determine is the criticality of a task starting
on time.

By that I mean, is it critical that a task start precisely at a point in
time or is it acceptable that a task start within, say, 10 seconds of a
point in time.

If it is the latter than you can decrease the granularity of your timer to,
say, 10 seconds (10000 ms), instead of 1 second (1000 ms).
"wanwan" <er*******@yahoo.comwrote in message
news:d6**********************************@s12g2000 prg.googlegroups.com...
On Jan 2, 6:21 pm, "Stephany Young" <noone@localhostwrote:
>It all depends on what your task needs to achieve.

If you explain that, then you are likely to get the appropriate advice.

"wanwan" <ericwa...@yahoo.comwrote in message

news:63**********************************@e25g200 0prg.googlegroups.com...
Hi,
I'm looking for a better way to do a date/time elapsed event rather
than a timer elapsed event.
Currently, I wrote my program to use a timer elapsed event set to 1
second, and it checks the date/time in the event. Is there a better
way?
Thanks.

my program allows setting actions running as one time events or
recurrent events(weekly, monthly ...). I think my current approach
(i.e. using one second timer) is very inefficient because there is no
need to do the check so frequently.

I need to know if there is anything in vb.net I can use where the
event is triggered by date and time.

Thanks.
Jan 3 '08 #4
On Jan 2, 5:43*pm, wanwan <ericwa...@yahoo.comwrote:
On Jan 2, 6:21 pm, "Stephany Young" <noone@localhostwrote:


It all depends on what your task needs to achieve.
If you explain that, then you are likely to get the appropriate advice.
"wanwan" <ericwa...@yahoo.comwrote in message
news:63**********************************@e25g2000 prg.googlegroups.com...
Hi,
I'm looking for a better way to do a date/time elapsed event rather
than a timer elapsed event.
Currently, I wrote my program to use a timer elapsed event set to 1
second, and it checks the date/time in the event. Is there a better
way?
Thanks.

my program allows setting actions running as one time events or
recurrent events(weekly, monthly *...). I think my current approach
(i.e. using one second timer) is very inefficient because there is no
need to do the check so frequently.

I need to know if there is anything in vb.net I can use where the
event is triggered by date and time.

Thanks.- Hide quoted text -

- Show quoted text -
Use the Windows Task Scheduler....

http://www.mvps.org/emorcillo/en/cod...asksched.shtml

is just one possible interface...

--
Tom Shelton
Jan 3 '08 #5
On Jan 2, 8:40 pm, "Stephany Young" <noone@localhostwrote:
Whatever you do, don't equate 'doing something frequently' with
'inefficient'.

Computers are designed to handle 'doing something frequently'. In fact
various parts of your computer are doing things 100's and even 1000's of
times every second.

Efficiency is more likely to be affected by what happens rather that how
often it happens.

The first thing you have to determine is the criticality of a task starting
on time.

By that I mean, is it critical that a task start precisely at a point in
time or is it acceptable that a task start within, say, 10 seconds of a
point in time.

If it is the latter than you can decrease the granularity of your timer to,
say, 10 seconds (10000 ms), instead of 1 second (1000 ms).

"wanwan" <ericwa...@yahoo.comwrote in message

news:d6**********************************@s12g2000 prg.googlegroups.com...
On Jan 2, 6:21 pm, "Stephany Young" <noone@localhostwrote:
It all depends on what your task needs to achieve.
If you explain that, then you are likely to get the appropriate advice.
"wanwan" <ericwa...@yahoo.comwrote in message
>news:63**********************************@e25g200 0prg.googlegroups.com...
Hi,
I'm looking for a better way to do a date/time elapsed event rather
than a timer elapsed event.
Currently, I wrote my program to use a timer elapsed event set to 1
second, and it checks the date/time in the event. Is there a better
way?
Thanks.
my program allows setting actions running as one time events or
recurrent events(weekly, monthly ...). I think my current approach
(i.e. using one second timer) is very inefficient because there is no
need to do the check so frequently.
I need to know if there is anything in vb.net I can use where the
event is triggered by date and time.
Thanks.
Hi Steph,

what I mean is that my current approach is actually a form of polling.
It doesn't matter for one second timer or a ten second timer. For
example, a weekly event requires the program to run the event
repeatedly for a week before the computer actually does something
useful. Although modern computer can afford to waste these cycles,
it's still poor programming technique. Imagine what happens if I want
my program to handle 1000 weekly events with a precision of 1
millisecond?

what I am looking for is a way to wait on a date/time event based on
the concept of interrupt or blocking. So the program can better handle
large number of events.
I'm just hoping vb.net has something built in that I can use.
Eric
Jan 3 '08 #6
The answer is no, it doesn't.

See Tom's response re Task Scheduler.
"wanwan" <er*******@yahoo.comwrote in message
news:bf**********************************@t47g2000 hsd.googlegroups.com...
On Jan 2, 8:40 pm, "Stephany Young" <noone@localhostwrote:
>Whatever you do, don't equate 'doing something frequently' with
'inefficient'.

Computers are designed to handle 'doing something frequently'. In fact
various parts of your computer are doing things 100's and even 1000's of
times every second.

Efficiency is more likely to be affected by what happens rather that how
often it happens.

The first thing you have to determine is the criticality of a task
starting
on time.

By that I mean, is it critical that a task start precisely at a point in
time or is it acceptable that a task start within, say, 10 seconds of a
point in time.

If it is the latter than you can decrease the granularity of your timer
to,
say, 10 seconds (10000 ms), instead of 1 second (1000 ms).

"wanwan" <ericwa...@yahoo.comwrote in message

news:d6**********************************@s12g200 0prg.googlegroups.com...
On Jan 2, 6:21 pm, "Stephany Young" <noone@localhostwrote:
It all depends on what your task needs to achieve.
>If you explain that, then you are likely to get the appropriate
advice.
>"wanwan" <ericwa...@yahoo.comwrote in message
>>news:63**********************************@e25g20 00prg.googlegroups.com...
Hi,
I'm looking for a better way to do a date/time elapsed event rather
than a timer elapsed event.
Currently, I wrote my program to use a timer elapsed event set to 1
second, and it checks the date/time in the event. Is there a better
way?
Thanks.
my program allows setting actions running as one time events or
recurrent events(weekly, monthly ...). I think my current approach
(i.e. using one second timer) is very inefficient because there is no
need to do the check so frequently.
I need to know if there is anything in vb.net I can use where the
event is triggered by date and time.
Thanks.

Hi Steph,

what I mean is that my current approach is actually a form of polling.
It doesn't matter for one second timer or a ten second timer. For
example, a weekly event requires the program to run the event
repeatedly for a week before the computer actually does something
useful. Although modern computer can afford to waste these cycles,
it's still poor programming technique. Imagine what happens if I want
my program to handle 1000 weekly events with a precision of 1
millisecond?

what I am looking for is a way to wait on a date/time event based on
the concept of interrupt or blocking. So the program can better handle
large number of events.
I'm just hoping vb.net has something built in that I can use.
Eric
Jan 3 '08 #7
Wanwan,

It seems to me that your program (which is even not a Windows Service) has
to run everytime and the power should never goes down. (If it is a smaller
amount then you can calculate the ticks to that point and then set a timer
elapsing event to that point, but for a week this seems for me even to long
for a service). (Be aware that that timer event has as well to be processed,
however it is most probably faster than doing it yourself every time).

Have a look at the link that Tom is supporting around the scheduler.

Cor

Jan 3 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Marc | last post by:
I've got a PHP script that's using fopen to connect to a remote web server and pick up data. I've run into a problem in calculating elapsed time. The remote web server outputs a time and I'd...
3
by: rhaley | last post by:
ugh. Okay, I need to figure out the number of milliseconds between DateTime.Now and the end of the day so that I can make changes based on the date roll-over. I need to implement a Timer so that I...
16
by: Tim Davidge | last post by:
Hi folks, been a while since I have posted a plea for help and I think I have forgotten everything I learnt from the helpful contributors to this newsgroup, that said however : I'm trying to...
1
by: untiroalaire | last post by:
Hi, here's what I'd like to do: get the time difference (Elapsed) between the "received date" field for all emails (running total) I've dumped into access from outlook and summarize at the...
0
by: Microsoft | last post by:
I'm creating a service and am using a timer in it. When the service starts I enable the timer, and then in the timer elasped event, I'm disabling it (this.srvcTimer.Enabled = false) so the timer...
0
by: Anurag | last post by:
Hi, ENV: DB2 ESE 8.2.3 DPF (11 nodes) on AIX 5.x ==== SCENARIO / SETUP ======== ====== (1) I needed to find out CPU Time (User / System) of SQL queries for benchmark testing. (2) I setup...
1
by: Rush | last post by:
hey, I am working on creating a countdown from the current date to a specified date later on, using days, hours, minutes, and seconds, updating every second. I have been searching and searching,...
0
by: simplediscourse | last post by:
i'm trying to demonstrate timeslicing among equal high priority threads without putting threads to sleep. to do this i'm trying to run a timer while executing a very long loop sequence in order to...
5
by: mmi48 | last post by:
Most of the discussions I've seen about elapsed time have, thus far, involved at least two date/time fields. I am trying to calculate time elapsed from one field across multiple records. The field...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.