"peteZ" <peteZ@aol.co m> wrote in message
news:e$aI1$uhDH A.4024@TK2MSFTN GP11.phx.gbl...[color=blue]
> How can I tell my C# program to do nothing for 5 secs ?
>
> ie. I want to slow down a process and introduce a deliberate delay.
>[/color]
Learn C# with step-by-step tutorials and practical examples. Start your first program, explore lists and parsing, and understand how .NET runs your code.
"Michael Culley" <mculley@NOSPAM optushome.com.a u> wrote in message
news:%238yXEewh DHA.752@TK2MSFT NGP12.phx.gbl.. .[color=blue]
> Won't that lock the app solid for 5 seconds? Better to use a loop with a[/color]
DoEvents in it that checks for Now + 5seconds, or use a[color=blue]
> timer.[/color]
Sure, if he does it on the UI thread. The question wasn't that specific.
For long running processes, I'll consider pushing it off on a secondary
Thread or do an asynchronous call.
Learn C# with step-by-step tutorials and practical examples. Start your first program, explore lists and parsing, and understand how .NET runs your code.
"Joe Mayo" <jmayo@ddiieess ppaammeerrssddi iee.com> wrote in message
news:eQH7cLvhDH A.3104@TK2MSFTN GP11.phx.gbl...[color=blue]
> "peteZ" <peteZ@aol.co m> wrote in message
> news:e$aI1$uhDH A.4024@TK2MSFTN GP11.phx.gbl...[color=green]
> > How can I tell my C# program to do nothing for 5 secs ?
> >
> > ie. I want to slow down a process and introduce a deliberate delay.
> >[/color]
>
> Hi Petz,
>
> Try this:
>
> using System.Threadin g;
>
> ...
>
> Thread.Sleep(50 00);
>
>
> Joe
> --
> http://www.csharp-station.com
>
>[/color]
Comment