Re: How to make Metronome?
Re: How to make Metronome?
- Subject: Re: How to make Metronome?
- From: AgentM <email@hidden>
- Date: Sat, 2 Sep 2006 19:46:32 -0400
On Sep 2, 2006, at 6:47 PM, Matt wrote:
Hello
I am new to Cocoa. How can I make a metronome in cocoa? I tried using
NSTimer but it doesn't work - its very inaccurate. Any ideas?
Matt
Instead of relying on the timer to keep track of time, you should
simply use it as an updating callback. Then in the timer callback,
call [NSDate timeIntervalSinceReferenceDate] and subtract that from
the last time that the callback was called. That is the duration of
time that has past since the last callback. Now you know what you
need to render. Good luck!
-M
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden