Re: How can I make my VB .Net program sleep for 5 minutes?
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:%236hyiJ8j EHA.2908@tk2msf tngp13.phx.gbl. ..[color=blue]
> * "Roger Solano" <rsolano@cobeca .com> scripsit:[color=green]
> > How can I make my VB .net program sleep or pause for say 5 minutes?[/color]
>
> 'System.Threadi ng.Thread.Sleep (5000)'.[/color]
I think it's in milliseconds so 5 minutes would be
'System.Threadi ng.Thread.Sleep (300000)' 'three hundred thousand ms.
Re: How can I make my VB .Net program sleep for 5 minutes?
Ricky[color=blue]
>
> I think it's in milliseconds so 5 minutes would be
> 'System.Threadi ng.Thread.Sleep (300000)' 'three hundred thousand ms.[/color]
You know how fast Herfried is he post in a second what another does in a
minute.
Re: How can I make my VB .Net program sleep for 5 minutes?
Roger,
In additon to the others,
When you do this than mostly is adviced to use a timer or to use a different
thread. Because your program stops completly and your user cannot even
cancel it in a normal way.
An easy way to prevent that freezing is
For i = 1 to 300
threading.threa d.sleep(i * 1000)
application.doe vents
next
[color=blue]
> How can I make my VB .net program sleep or pause for say 5 minutes?
>
> Any help would be much appreciated.
>
> Roger
>
>[/color]
Re: How can I make my VB .Net program sleep for 5 minutes?
* "Ricky W. Hunt" <rhunt22@hotmai l.com> scripsit:[color=blue][color=green][color=darkred]
>>> How can I make my VB .net program sleep or pause for say 5 minutes?[/color]
>>
>> 'System.Threadi ng.Thread.Sleep (5000)'.[/color]
>
> I think it's in milliseconds so 5 minutes would be
> 'System.Threadi ng.Thread.Sleep (300000)' 'three hundred thousand ms.[/color]
Ooops. I mixed up 5 minutes with 5 seconds...
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Re: How can I make my VB .Net program sleep for 5 minutes?
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:ewzPieBkEH A.2340@TK2MSFTN GP11.phx.gbl...[color=blue]
> * "Ricky W. Hunt" <rhunt22@hotmai l.com> scripsit:[color=green][color=darkred]
> >>> How can I make my VB .net program sleep or pause for say 5 minutes?
> >>
> >> 'System.Threadi ng.Thread.Sleep (5000)'.[/color]
> >
> > I think it's in milliseconds so 5 minutes would be
> > 'System.Threadi ng.Thread.Sleep (300000)' 'three hundred thousand ms.[/color]
>
> Ooops. I mixed up 5 minutes with 5 seconds...[/color]
Herfried, what does a program actually "do" during this sleep time? Is it
consuming any resources other than memory?
Re: How can I make my VB .Net program sleep for 5 minutes?
* "Ricky W. Hunt" <rhunt22@hotmai l.com> scripsit:[color=blue][color=green][color=darkred]
>>>>> How can I make my VB .net program sleep or pause for say 5 minutes?
>>>>
>>>> 'System.Threadi ng.Thread.Sleep (5000)'.
>>>
>>> I think it's in milliseconds so 5 minutes would be
>>> 'System.Threadi ng.Thread.Sleep (300000)' 'three hundred thousand ms.[/color]
>>
>> Ooops. I mixed up 5 minutes with 5 seconds...[/color]
>
> Herfried, what does a program actually "do" during this sleep time? Is it
> consuming any resources other than memory?[/color]
It still uses its resources, but it doesn't get any processor time. So
the UI will be "locked" in this time.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Comment