Sleep [Archive] - C Board

PDA

View Full Version : Sleep


nvoigt
02-11-2002, 05:32 AM
I know it's a somewhat silly question, but how do I wait a specified time ? The Sleep function is a method of my thread, but how do I get the thread I'm in ?

Sorensen
02-11-2002, 11:53 AM
This sleeps -

using System;
using System.Threading;

namespace Sleep
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
static void Main(string[] args)
{
Console.Write("..1..");
Thread.Sleep(1000);
Console.Write("..2..");

}
}
}

nvoigt
02-12-2002, 12:50 AM
DOH !

Thanks :)

Govtcheez
02-14-2002, 02:47 PM
> but how do I wait a specified time

Oh my God! This question's been answered half a million times before! And that's just today! Use the search, you lazy bastard! :p

nvoigt
02-14-2002, 04:04 PM
well... this is my assignment, and it's due in three and a half minutes, so I had no time to look it up myself ;)

CompiledMonkey
02-17-2002, 12:08 AM
lol, that's exactly like Java.