AbsoluteTime manipulatiion

Member
Posts: 157
Joined: 2002.12
Post: #1
Hello again.

I have an AbsoluteTime which I get with UpTime().
How do I offset that time let's say 1 frame running at 30fps?

thanks
Quote this message in a reply
Moderator
Posts: 1,562
Joined: 2003.10
Post: #2
This might be useful, though the page has a "this is obsolete" warning on it... http://developer.apple.com/documentation...html#34690
Quote this message in a reply
Member
Posts: 157
Joined: 2002.12
Post: #3
yep is mark as obsolete, but no pointers on what should be used instead.
in any case, there's the solution.
Code:
AbsoluteTime t = UpTime();
Duration d = (1000/30);
// subtract 1 frame
t = SubDurationFromAbsolute(d, t);
// add 1 frame
t = AddDurationToAbsolute(d, t);
Quote this message in a reply
Post Reply