CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Sleep

  1. #1
    Join Date
    May 2002
    Location
    Ballymena
    Posts
    57

    Question Sleep

    Hi Guys,

    Would any of you know what the equivalent of:

    C++: Sleep( 1000 );

    would be in C#?

    Thanks,
    Jenny

  2. #2
    Join Date
    Apr 2002
    Location
    Germany
    Posts
    10

    Re: Sleep

    Hello!

    Would any of you know what the equivalent of:

    C++: Sleep( 1000 );
    Try System.Threading.Thread.Sleep(1000);


    Best regards,
    Thomas Hetzer

  3. #3
    Join Date
    May 2002
    Location
    Ballymena
    Posts
    57
    Hi,

    Thanks for that...

    Does it still do the same job if you arent using threads?

    Thanks,
    Jenny

  4. #4
    Join Date
    Apr 2002
    Location
    Germany
    Posts
    10
    Hello!

    Does it still do the same job if you arent using threads?
    You are always using threads. Even if you do not start additional threads, your code is executed in the main thread. If you call Thread.Sleep(1000) from your main thread, your main thread will be blocked for one second.



    Best regards,
    Thomas Hetzer

  5. #5
    Join Date
    May 2002
    Location
    Ballymena
    Posts
    57
    Thanks Thomas!
    You have really helped!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured