timers

This is a discussion on timers within the C Programming forums, part of the General Programming Boards category; Hello, I am searching for a way to do this: I want to establish a timer, which will expire in ...

  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,265
    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,265

  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, 08: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, 07: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21