473,396 Members | 2,020 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.

Waitable Timers in VB.NET

Hello everyone:
I am looking for some VB.NET code samples that make use of waitable
timers that put the thread of the application to Sleep for the
specificied period of time. I am told that the benefit of using a
Waitable timer to the Threading.thread.Sleep function is that the
application will still be responsive to events, whereas
Threading.thread.Sleep will just freeze the application for the set
interval.

I have some VB6 code and a waitable timer class that I could not make
use of it in VB.NET.

Example: 'This is an example for idling your application

' Private mobjWaitTimer As WaitTimer
' Private Sub RunProcess()
' Set mobjWaitTimer = New WaitTimer
' Do
' If mbWorkToDo Then
' Call ProcessWork()
' Else
' mobjWaitTimer.Wait(5000) 'Wait for 5 seconds
' End If
' Loop Until Not mbStop
' Set mobjWaitTimer = nothing
' End Sub

I thank everyone that tried to offer me help.

Mar 20 '06 #1
2 4890
Mike wrote:
Hello everyone:
I am looking for some VB.NET code samples that make use of waitable
timers that put the thread of the application to Sleep for the
specificied period of time. I am told that the benefit of using a
Waitable timer to the Threading.thread.Sleep function is that the
application will still be responsive to events, whereas
Threading.thread.Sleep will just freeze the application for the set
interval.

I have some VB6 code and a waitable timer class that I could not make
use of it in VB.NET.

Example: 'This is an example for idling your application

' Private mobjWaitTimer As WaitTimer
' Private Sub RunProcess()
' Set mobjWaitTimer = New WaitTimer
' Do
' If mbWorkToDo Then
' Call ProcessWork()
' Else
' mobjWaitTimer.Wait(5000) 'Wait for 5 seconds
' End If
' Loop Until Not mbStop
' Set mobjWaitTimer = nothing
' End Sub

I thank everyone that tried to offer me help.


The timer object does basically the same thing. You can have it fire
every five seconds (turn it off during your processing cycle) and the
application will still respond to events.

Chris
Mar 20 '06 #2
Hello Chris,

Thank you for your reply.

I thought about that. But, I already use more than four timers and many
other components in the application.
I was just wondering if I could do anything simillar to the WaitTimer
API..

Please let me know if there is any other alternatives. Otherwise, I
shall go with a timer.

Thanks once again for your help.

Mar 20 '06 #3

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

Similar topics

1
by: GDumencu | last post by:
I have a C# program that have to run all the time. For some reasons I cannot make it a service. This program has 3 timers and by time to time ( days or weeks) one of them stops. Some times, starts...
0
by: Dmitry Demchuk | last post by:
Hi everybody. Recently I ran into situation with System.Threading.Timer in my ASP.NET application. I reinstalled Windows on one of my servers and got timers stop firing events after while, they...
1
by: Dinesh Eswaran | last post by:
hi all, I want to create a waitable timer in C#. How do I do it? There is Timer class and there is the WaitHandle class with WaitAny... methods. But they dont seem to help. Basically iam looking...
9
by: Mark Rae | last post by:
Hi, I've seen several articles about using System Timers in ASP.NET solutions, specifically setting them up in Global.asax' Application_OnStart event. I'm thinking about the scenario where I...
1
by: | last post by:
Frustrated.. (I have seen other posts regarding this problem with no resolution..) I am using dotnet 1.1 with latest SP on a Win2KP box (actually 2 boxes), have even run the service on WinXP SP2...
5
by: Lonewolf | last post by:
Hi all, I am not sure if it is even possible to do it from .NET itself. Is there something like a waitable timer which can resume the system from its hibernate or standby (S3: suspend to ram)...
0
by: Mike | last post by:
Hello everyone: I am looking for some VB.NET code samples that make use of waitable timers that put the thread of the application to Sleep for the specificied period of time. I am told that the...
1
by: Jonathan Woods | last post by:
Hi there, I have three methods these need to execute at every interval time. I would like to know which option is better? Option A) Three System.Timers.Timer objects these execute each...
0
by: Sam | last post by:
Hello: Can anyone provide me some idea on how to replace the Sleep method. Major Disadvantage that I have been facing with the Sleep method is that the application freezes during the sleep time...
11
by: =?Utf-8?B?RXJpYw==?= | last post by:
I'm coming from Win32 world. Now, I'm porting the existing code to C#. I cannot find the equivalent Win32 Waitable Timer in C#. I have a thread to perform some task periodically like following: ...
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
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
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.