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

Hybrid View

  1. #1
    Join Date
    Mar 2001
    Posts
    2,529

    Why would sleep code exist in an event handler?

    Im working on an existing WinForms app and I found an event handler that had immediate System.Threading.Sleep() calls in it in one of the events / cases. I found that odd behavior and so I eliminated the sleep from the event handler. This broke another case / event. When I put the sleep back in, system "sanity" was restored. Now my sanity is on the line because I don't like it. Should one ever sleep in an event handler? This seems like an awful slow way to do buisness.
    ahoodin
    To keep the plot moving, that's why.

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Why would sleep code exist in an event handler?

    Does the sleep have a value or is it 0?

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