473,396 Members | 1,967 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.

Pausing Program Execution - 5 Minutes

Hi:

I'm trying to write a routine that will permit my VB.NET program to
pause execution for five minutes and try a task again if there is a
failure. After a set number of tries it should return a failure
notification.

I know how to do everything except make it hibernate for five minutes -
if anyone knows how to do this I would GREATLY apprecaite it!

============================================
Logially:

dim error_counter as integer = 0

while error_counter < 10

if callmainfunction()
' it worked - return
return .t.
endif

' add one to the error counter:
error_counter += 1

** wait five minutes

"system.sleep(5 minutes)"

end while

return .f.
==========================

Thanks very much!

Fred
Nov 21 '05 #1
4 2898
Hi Again:

I found that:

system.threading.thread.sleep(miliseconds)

works just fine!
Fred Nelson wrote:
Hi:

I'm trying to write a routine that will permit my VB.NET program to
pause execution for five minutes and try a task again if there is a
failure. After a set number of tries it should return a failure
notification.

I know how to do everything except make it hibernate for five minutes -
if anyone knows how to do this I would GREATLY apprecaite it!

============================================
Logially:

dim error_counter as integer = 0

while error_counter < 10

if callmainfunction()
' it worked - return
return .t.
endif

' add one to the error counter:
error_counter += 1

** wait five minutes

"system.sleep(5 minutes)"

end while

return .f.
==========================

Thanks very much!

Fred

Nov 21 '05 #2
* Fred Nelson <fr**@smartybird.com> scripsit:
I found that:

system.threading.thread.sleep(miliseconds)


Notice that this will block your app's user interface when calling this
method from within your main thread.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #3
Herfried:

I have noticed that and in this case its OK. I force a status box that
I'm using to perform a .UPDATE() so I can see what's going on.

Thanks for your help!

Fred

Herfried K. Wagner [MVP] wrote:
* Fred Nelson <fr**@smartybird.com> scripsit:
I found that:

system.threading.thread.sleep(miliseconds)

Notice that this will block your app's user interface when calling this
method from within your main thread.

Nov 21 '05 #4
Fred,

And when not, you can set it in a simple loop doing it 300 times a second
and place in that loop

application.doevents

Just a simple addition.

Cor
Herfried:

I have noticed that and in this case its OK. I force a status box that
I'm using to perform a .UPDATE() so I can see what's going on.

Thanks for your help!

Fred

Herfried K. Wagner [MVP] wrote:
* Fred Nelson <fr**@smartybird.com> scripsit:
I found that:

system.threading.thread.sleep(miliseconds)

Notice that this will block your app's user interface when calling this
method from within your main thread.

Nov 21 '05 #5

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

Similar topics

3
by: Graham | last post by:
How can I cause a python program to pause/suspend execution for a period of time? I am checking status of an external system and only want to check every second as opposed to my current which...
12
by: Simon John | last post by:
I'm writing a PyQt network client for XMMS, using the InetCtrl plugin, that on connection receives a track length. To save on bandwidth, I don't want to be continually querying the server for...
7
by: Dr. Know | last post by:
I am working on an ASP page that writes to several databases, ranging from MDBs to x-base. One of the tasks involves using an existing highest value from the DB and incrementing it before...
5
by: Johannes Lebek | last post by:
Hi there, lately, I experienced a strange thing on my DB2 V8.1 on Windows: Some queries took a very long time. A snapshot discovered the following: Number of executions = 47...
15
by: jcrouse | last post by:
Here is my code: Dim sw As StreamWriter = File.CreateText(Application.StartupPath & "\mameversion.bat") sw.WriteLine(lblMameExePath.Text & " -help >""" & Application.StartupPath &...
7
by: Charles Law | last post by:
My first thought was to call WorkerThread.Suspend but the help cautions against this (for good reason) because the caller has no control over where the thread actually stops, and it might have...
25
by: Kwebway Konongo | last post by:
Hi everyone, I'm developing an application in C; basically a linked list, with a series of "events" to be popped off, separated by a command to pause reading off the next event in the list. It has...
12
by: greg | last post by:
Hi, Can anyone help me with the following issue: How can I pause the execution of a program until a given file is created (by another process) in a specified directory? Any ideas would be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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.