473,413 Members | 1,989 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,413 software developers and data experts.

Accurate Timer that fires on relative time

Hello,

I am building an application that requires an accurate timer to be fired every X minutes. This x value will change based on the user's requirements.

I've looked into using the Timer class. I cannot use this becuase it fires every X minutes from when I started the applicaation.

For instance, if I start the application at 14:33:00 and I want it to fire every 5 minutes, it will fire again around 14:38:00. I need it to fire every 5th minute in an hour. Continuing with my example, if I start it at 14:33, it should fire at 14:35, 14:40, etc.

Also, I wouldnt mind if it was synced to the system clock.

My question is this:

Does this exist? And if so, where can I find something to lead me in the right direction.

Thanks in advance.
Feb 22 '08 #1
1 868
Could you just find the diference between time now and the next interval, set the timer to that initial time delta, then back to 5 min after it hits the first one?

-dan
Feb 22 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Qiangning Hong | last post by:
I asked this question on comp.python.wxpython using the subject "a wx.Timer like timer without wx package?" and David Fraser there suggested me to ask here for a more general solution. I am...
3
by: User | last post by:
Hi, What is the best way to release all resources holded by the Timer (myTimer from class System.Timers.Timer)? Is it: 1- myTimer.dispose 2- myTimer.enabled = false 3- myTimer.close
3
by: Mr. B | last post by:
My current app has a timer that I kick ON in my Form1_Load as follows: ' Set Up the Timer Function Dim t As New System.Timers.Timer(12000) ' 1000 = 1 Second t.Enabled = True ' False to Turn OFF...
5
by: Stephan Wörmke | last post by:
Hi! In one of our experiments we are using piezo electric transducers to move a stage. So far a feedback loop was implemented using the real-time system from venturcom. We now would like to use...
9
by: HL | last post by:
I am using VS 2005 Beta - C# Problem: The Timer fires a few milliseconds before the actual Due-Time Let's say a timer is created in the following manner: System.Threading.Timer m_timer = null;...
5
by: Tom Edelbrok | last post by:
I have narrowed down a previous problem to the following more specific items: 1) I have my startup object in VB.NET (VS 2003) set to Sub Main(). 2) Inside of Sub Main() I do a...
5
by: Flack | last post by:
Hey guys, Here is what I am trying to achieve: I have a grid, and every once in a while the grid will receive a message to add a new row and highlight it (change the backcolor) for five...
5
by: derSchweiz | last post by:
I have an application that requires the use of a timer and I have created the timer object globally: Private t As New System.Timers.Timer(4000) And I have a button that that triggers an event...
2
by: Johnny Jörgensen | last post by:
I've got a process I want to run in a thread separate from my main application thread, so I've used a backgroundworker component, and in frmMain.Load I invoke the code using...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.