Talk About Network

Google





Mac > Mac Programmer Help > Re: How to make...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 9 Topic 3683 of 3889
Post > Topic >>

Re: How to make a fla****ng light?

by Jim <jim@[EMAIL PROTECTED] > Apr 1, 2008 at 01:56 PM

On 2008-04-01, Gregory Weston <uce@[EMAIL PROTECTED]
> wrote:
>> 
>> Out of interest - and this is purely a hypothetical question - how
would I
>> have two timers, both firing at 2 second inteveals but separeted by a
>> second?
>> 
>> I realise that timers aren't _very_ precise, hence the question may be
>> nonsense. I'm just curious.
>
> You wouldn't. What you would do depends on what you're really trying to 
> accomplish.
>
> If you really wanted to work with multiple timers you'd probably issue 
> two calls to the Carbon routine InstallEventLoopTimer() with the second 
> argument for each set to put them appropriately out of phase with each 
> other. But if you're looking, for example, to have a timer firing every 
> two seconds to set the LED image to "off" and another firing every 2 
> seconds (but offset by 1 second from the first) to set it to either red 
> or green on, I'd say you should really just have a single timer that 
> fires every second and sets it appropriate based on both the current 
> state and the external is-it-up flag.

It wasn't for that purpose - as you say I'd control it all with a single
timer and variable tweaking.

I didn't really have a purpose in mind, it was just a random 'I wonder
how...' moment.

Thank you.

Jim
-- 
http://www.ursaMinorBeta.co.uk
"When one of the local cats, an especially fluffy creature with a vast
tail, rushed down the street towards me the other day, mewing delightedly,
I have to admit it was probably shouting 'HAZ CHEZBURGR?' " - Bella, ucsm
 




 9 Posts in Topic:
How to make a flashing light?
Jim <jim@[EMAIL PROTEC  2008-04-01 10:40:12 
Re: How to make a flashing light?
Gregory Weston <uce@[E  2008-04-01 06:07:13 
Re: How to make a flashing light?
Jim <jim@[EMAIL PROTEC  2008-04-01 11:15:10 
Re: How to make a flashing light?
Gregory Weston <uce@[E  2008-04-01 12:49:03 
Re: How to make a flashing light?
Jim <jim@[EMAIL PROTEC  2008-04-01 13:56:14 
Re: How to make a flashing light?
Heath Raftery <hrafter  2008-04-01 23:01:38 
Re: How to make a flashing light?
Jim <jim@[EMAIL PROTEC  2008-04-02 07:22:17 
Re: How to make a flashing light?
Tom Harrington <tph@[E  2008-04-01 09:25:49 
Re: How to make a flashing light?
Jim <jim@[EMAIL PROTEC  2008-04-02 07:20:36 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Wed Jan 7 18:59:20 PST 2009.