DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: High Resolution Version of Sleep() in Windows

Hybrid View

  1. #1
    Join Date
    Aug 2005

    High Resolution Version of Sleep() in Windows

    Has anyone come across a way to sleep (suspend execution of current process while releasing CPU resources in the meantime) for less than a millisecond in Windows? I know it has been done by third parties such as with the XBO LLADRV project, but I cannot get even enough support from them to enable their software in my project. Ideally, I need something like the unix usleep() function which will do a processor-friendly sleep for some number of microseconds or nanoseconds. The LLADRV project supposedly does this for Windows through low-level access to the OS using their LladrvWaitPreciseTime() function.

    I am using MSVC++ .Net 2003. Thanks for any leads.

  2. #2
    Join Date
    Nov 2003
    I don't know if this is really feasible: putting a process to sleep means much more than just suspending its CPU usage: it means releasing some resources, marking a few flags, signaling the kernel, and performing a context switch (that is, waking up another process). You can't accomplish these operations in a few nanoseconds so the real question here is: what do you want to accomplish? If it's just delaying the current execution of the process, I think wait() would be a better choice. If it's letting other processes utilize the CPU, then Sleep() or sleep() would do but for longer time spans than micro seconds.
    Danny Kalev

Similar Threads

  1. Replies: 1
    Last Post: 08-29-2001, 09:14 AM
  2. C# Windows Application
    By Dharmesh in forum .NET
    Replies: 0
    Last Post: 08-03-2001, 04:45 AM
  3. myLittleAdmin SQL Server version
    By in forum web.announcements
    Replies: 0
    Last Post: 03-10-2001, 01:35 PM
  4. Replies: 0
    Last Post: 11-05-2000, 12:53 AM
  5. Replies: 0
    Last Post: 11-05-2000, 12:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center