Thread: Using timers

  1. #1
    Anal comment spacer DominicTrix's Avatar
    Join Date
    Apr 2002
    Posts
    120

    Using timers

    I'm using SetTimer() to initialize my timer and it all works fine. However, I would like to know a way of halting the flow of code until my timer has finished so that nothing happens till my timer stuff is done i.e. when I kill the timer. Any ideas?

    thanks in advance

    dom
    Last edited by DominicTrix; 04-19-2002 at 10:34 AM.

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    Don't understand.

    When you call SetTimer() you are requesting Windows to send you a WM_TIMER message when the timer expires, if you don't want to do anything until that happens, when you set the timer, set a flag, and ignore all messages until the WM_TIMER message comes in, when you can reset the flag.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  3. #3
    Anal comment spacer DominicTrix's Avatar
    Join Date
    Apr 2002
    Posts
    120
    Sorry, I've just figured it out. I didn't quite get the whole timer concept really!

    I basically wanted to animate cards being dealt until they were all dealt and I didn't want anything happening in the mean time.

    I've now used GetTickCount in a while() loop and it seems to working.

    Thanks anyway!

    Dom

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. timers in c
    By steve1_rm in forum C Programming
    Replies: 10
    Last Post: 02-24-2009, 12:34 PM
  2. Threads and Timers
    By scioner in forum C Programming
    Replies: 8
    Last Post: 03-22-2008, 07:56 AM
  3. Timers, Timers, Timers!
    By Stan100 in forum Game Programming
    Replies: 9
    Last Post: 01-24-2003, 04:45 PM
  4. Timers
    By Mox in forum Windows Programming
    Replies: 2
    Last Post: 11-09-2001, 04:34 AM