Thread: Time delay in C

  1. #1
    Registered User
    Join Date
    Apr 2015
    Posts
    2

    Time delay in C

    Hi!
    How do we implement time delay in C without using loops? Is there a function? If so, what is the header file?
    Thanks.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,666
    It depends on your compiler and OS

    Quote Originally Posted by manpage
    SLEEP(3) Linux Programmer's Manual SLEEP(3)

    NAME
    sleep - Sleep for the specified number of seconds

    SYNOPSIS
    #include <unistd.h>

    unsigned int sleep(unsigned int seconds);

    DESCRIPTION
    sleep() makes the calling thread sleep until seconds seconds have elapsed or a signal arrives which is not ignored.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Apr 2015
    Posts
    2
    Thanks, Salem

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. time.h & Delay
    By gavra in forum C Programming
    Replies: 27
    Last Post: 07-29-2008, 08:53 AM
  2. Time Delay
    By dragonklown in forum C++ Programming
    Replies: 12
    Last Post: 02-10-2005, 06:18 PM
  3. Time delay
    By Superfrog in forum C++ Programming
    Replies: 5
    Last Post: 09-29-2004, 10:46 AM
  4. Delay Time?? Need As Soon As Possible
    By bigB8210 in forum C Programming
    Replies: 15
    Last Post: 07-15-2003, 04:39 PM
  5. Time Delay
    By Boaz in forum C Programming
    Replies: 3
    Last Post: 04-03-2003, 01:47 PM