#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    8
    Rep Power
    0

    How to use sleep() in devc++?


    So I am trying to put this function
    sleep(3); so that the printing of phrases would not come simultaneously. The function works when I compile it using cygwin but when I try devc++, it does not work there. When I click compile and run, it just prints them all at one time.

    Is there any special headers that I need to use in devc++?

    My headers:

    #include<stdio.h>
    #include<string.h>
    #include<stdlib.h>
    #include<unistd.h>
  2. #2
  3. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,184
    Rep Power
    2222
    In UNIX/Linux, sleep's argument is the number of seconds. In Windows, it's the number of milliseconds. Having never used cygwin, I do not know under it, but would assume that it's the UNIX/Linux standard. Try sleep(3000).

    Comments on this post

    • eramit2010 agrees
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    8
    Rep Power
    0
    Originally Posted by dwise1_aol
    In UNIX/Linux, sleep's argument is the number of seconds. In Windows, it's the number of milliseconds. Having never used cygwin, I do not know under it, but would assume that it's the UNIX/Linux standard. Try sleep(3000).
    Thank you so much!It's working :D

IMN logo majestic logo threadwatch logo seochat tools logo