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

Timer Problems with vb.net

I have an aplications that need to be running at all times within this application there is a process that needs to start at a certain time. I have tried using the time with in vb.net windows forms but if I had to put the application on to check every minute the the program will use to much of the user's pc memory. The program is suppossed to be non invasive. I was wondering if there is any other way to check for times that don't affect the pc to much.
Sep 1 '08 #1
2 1095
vekipeki
229 Expert 100+
I did not actually understand what problems you are having - if you are asking how to start another application from your app, you should use something like:
Expand|Select|Wrap|Line Numbers
  1. System.Diagnostics.Process.Start("some_path\other_app.exe")
which should be placed in your Timer's event handler, with Timer.Interval set to 60000 ms.

This will start your other app, which should close itself when it's done. This other app will use some memory, but if you need the job done, I guess it is up to you to write the simplest possible program which does what you need.

The other thing that might be concerning you is that your Timer app by itself probably uses ~20Mb of your memory, because it is running under .NET CLR. There is no cure for that :) - the only option to get rid of .NET is to use native C++.

On the other hand, if you're doing this for home use and need to do some simple file handling, why don't you just use Windows' task scheduler and add a repetitive task for some batch or cmd file?
Sep 1 '08 #2
joedeene
583 512MB
if in vb.net, why not use some of the my.computer.clock methods/functions ? like start a thread, set its .background property to true, and in the thread either make a timer that checks the time every 1000 ms, or something, or do a "Do" statement, like


Expand|Select|Wrap|Line Numbers
  1. Do Until My.Computer.Clock.LocalTime.Hour = 8
  2.          Threading.Thread.Sleep(100)
  3.       Loop
  4.         Do Until My.Computer.Clock.LocalTime.Minute = 55
  5.             Threading.Thread.Sleep(500)
  6.              Loop
  7. Process.Start("MYPROCESS") 'replace with process you want, because once the hour is right, it waits for the minute to be right, then it will start the process, did this help? and make sure its running background on a new thread started from your main form...
Sep 1 '08 #3

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

Similar topics

1
by: Geoff | last post by:
Hey.. I'm having problems with stopping this timer from outside the 'runTimer()' class.. i have no problems calling 'cancel()' from inside the run() method but I want to be able to stop the Timer...
13
by: Manuel Lopez | last post by:
I have a puzzling form timer problem that I didn't experience prior to Access 2003 (though I'm not sure access 2003 is to blame). Here's the situation: a computer has two access 2003 databases on...
4
by: Anthony Boudouvas | last post by:
Hi to all, i have a form with 2 System.Windows.Forms.Timer objects. One fire every 5 seconds and the other every 10 seconds, the both take actions in two hashtables declared in same form. ...
8
by: Daniel P. | last post by:
I'm trying to set a timer that gets called every 3 seconds so I can update a field in the UI with the time elapsed since the process started. What am I doing wrong that timerDF_Tick does not get...
6
by: Dan | last post by:
I've created a pocketpc app which has a startup form containing a listview. The form creates an object which in turn creates a System.Threading.Timer. It keeps track of the Timer state using a...
3
by: mjheitland | last post by:
Hi, I like to know how many threads are used by a Threading.Timer object. When I create a Threading.Timer object calling a short running method every 5 seconds I expected to have one additional...
4
by: Nijazi Halimaji | last post by:
Hi everybody I have created a new timer object WithEvents tmr_check As New System.Timers.Timer On my form_Load-Event I activated the timer... Then I made a label on my form and putted on...
11
by: Philip Wagenaar | last post by:
Hello, I am using a timer object in my Windows Forms Application. Does the code in ..elapsed event run in a diffrent thread? If the interval is set to 10 milliseconds and the time to execute the...
4
by: Varangian | last post by:
Hi there, I'm having problems using the Timer i.e. System.Timers.Timer (not the one found on the toolbox) in a webapplication and its giving me problems. Although I'm setting the interval to 5...
0
by: PeterSchwennesen | last post by:
Problems starting a Timer Programmatically within a BackgroundWorker. I am trying to start a Timer inside a Backgroundworker. I want to start the BackGroundWorker and then have a timer tick a...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.