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

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

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

    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 / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    12,843

    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
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)