Thread: timer in C

  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    2

    timer in C

    Hi,

    Does standard C provide time interrupts?

    How can I generate a time interrupt for every 500ms?

    thanks,
    Bob

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Quote Originally Posted by nightking View Post
    Hi,

    Does standard C provide time interrupts?

    How can I generate a time interrupt for every 500ms?

    thanks,
    Bob
    No it does not
    use OS specific code
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  3. #3
    Registered User
    Join Date
    Jan 2009
    Posts
    2
    Thanks. Then, could you please let me know how I can do that in Linux?

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    This perhaps?
    http://linux.die.net/man/2/setitimer

    There are several ways, and it depends quite a bit on what you are actually trying to achieve.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. SIGALRM and timer
    By nkhambal in forum C Programming
    Replies: 1
    Last Post: 06-30-2008, 12:23 AM
  2. tic tac toe crashes :(
    By stien in forum Game Programming
    Replies: 4
    Last Post: 05-13-2007, 06:25 PM
  3. need help making a dot bounce up and down y axis in this prog
    By redwing26 in forum Game Programming
    Replies: 10
    Last Post: 08-05-2006, 12:48 PM
  4. Need help with a count down timer
    By GUIPenguin in forum C# Programming
    Replies: 0
    Last Post: 07-07-2006, 04:18 PM