Thread: timers

  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    4

    Question timers

    Hello,
    I am searching for a way to do this: I want to establish a timer, which will expire in an amount of time that I will specify. Upon the expiration, I want to be executed a subroutine of mine. Also I would like to ask what are the timed loops.
    Thanks a lot.

  2. #2
    Registered User
    Join Date
    Feb 2003
    Posts
    175
    What OS???

  3. #3
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    Creating something like a timer cannot be done with standard code since it is very OS dependent.

    If you are using windows, then I believe MSDN has a code sample for timers. I'll see if I can find it.

  4. #4
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268

  5. #5
    Obsessed with C chrismiceli's Avatar
    Join Date
    Jan 2003
    Posts
    501
    Some people also use posix compatible operating systems, in which case you will use setitimer:
    http://mkssoftware.com/docs/man3/setitimer.3.asp
    Help populate a c/c++ help irc channel
    server: irc://irc.efnet.net
    channel: #c

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Threads and Timers
    By scioner in forum C Programming
    Replies: 8
    Last Post: 03-22-2008, 07:56 AM
  2. Enumerating timers and hotkeys
    By maxorator in forum Windows Programming
    Replies: 3
    Last Post: 01-01-2007, 11:47 AM
  3. switch cases and timers
    By soranz in forum C++ Programming
    Replies: 5
    Last Post: 10-02-2005, 06:43 PM
  4. Timers, Timers, Timers!
    By Stan100 in forum Game Programming
    Replies: 9
    Last Post: 01-24-2003, 04:45 PM
  5. Timers
    By Mox in forum Windows Programming
    Replies: 2
    Last Post: 11-09-2001, 04:34 AM