Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. wait/sleep func for win32 console apps?

wait/sleep func for win32 console apps?

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sprudling
    wrote on last edited by
    #1

    Does one exist without #including and using Sleep()? Sprudling

    D 1 Reply Last reply
    0
    • S Sprudling

      Does one exist without #including and using Sleep()? Sprudling

      D Offline
      D Offline
      Daniel Lohmann
      wrote on last edited by
      #2

      Sprudling wrote: Does one exist without #including and using Sleep()? Are you asking for a portable solution or what is your problem with using just Sleep() :confused: -- Daniel Lohmann http://www.losoft.de

      S 1 Reply Last reply
      0
      • D Daniel Lohmann

        Sprudling wrote: Does one exist without #including and using Sleep()? Are you asking for a portable solution or what is your problem with using just Sleep() :confused: -- Daniel Lohmann http://www.losoft.de

        S Offline
        S Offline
        Sprudling
        wrote on last edited by
        #3

        I take it there is no such function, and there is no problem really except compiling takes 10 times longer when not using precompiled headers. Sprudling

        D 1 Reply Last reply
        0
        • S Sprudling

          I take it there is no such function, and there is no problem really except compiling takes 10 times longer when not using precompiled headers. Sprudling

          D Offline
          D Offline
          Daniel Lohmann
          wrote on last edited by
          #4

          Oh the compiling time - I see. You could decrease it a lot by defining some symbols to exclude rarly used stuff from the windows headers: #define WIN32_LEAN_AND_MEAN in front of your #include statement should help a lot. But of course, you could also take the one-line definition of Sleep out of the header and define it on your own, so you just don't need the header: extern "C" void Sleep( unsigned int msec ); should do it (don't forget to link against kernel32.lib) :-) -- Daniel Lohmann http://www.losoft.de

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups