How do you control time on the iPhone?
Hi friends!
How do you control time on the iPhone?
Is there any like SDL_GetTicks() to get miliseconds since app was launched?
I need something like that to control my animations and movements.
Any suggestion?
BTW: Better if I can use it through CPP.
Thanks a lot, I appreciate a lot your help and time.
How do you control time on the iPhone?
Is there any like SDL_GetTicks() to get miliseconds since app was launched?
I need something like that to control my animations and movements.
Any suggestion?
BTW: Better if I can use it through CPP.
Thanks a lot, I appreciate a lot your help and time.
Skorche and I accidentally posted some mach timing code in this other thread recently: http://www.idevgames.com/forum/showthread.php?t=16298
The iPhone can control time? Finally I can go back and stop myself from dating that one girl.
Sorry... couldn't help it
Sorry... couldn't help it
Howling Moon Software - CrayonBall for Mac and iPhone, Contract Game Dev Work
AnotherJake Wrote:Skorche and I accidentally posted some mach timing code in this other thread recently: http://www.idevgames.com/forum/showthread.php?t=16298
I already saw that post. Perhaps nanoseconds is too much accurate, I only need miliseconds.
Did you use that method on a game? Do you think it is suitable for games? I mean, does that method add overhead? (I have no idea about this).
Thanks a lot for your help.
Accuracy being in nanoseconds vs. milliseconds has little to do with performance or overhead. We modify it so it returns time in seconds as a double precision float. Yes it works great for games, which is why we use it.
Yeah, the extra precision certainly isn't going to break anything, and it's not going to be slower really.
As Jake said, it returns the time as a double in seconds, so it's easy to work with.
As Jake said, it returns the time as a double in seconds, so it's easy to work with.
Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Thanks a lot for replies.
As I just need miliseconds, What do you think (AnotherJake) if I modify your code with this?
miliseconds = (double)nanos*1.0e-6;
return miliseconds;
Thanks.
As I just need miliseconds, What do you think (AnotherJake) if I modify your code with this?
miliseconds = (double)nanos*1.0e-6;
return miliseconds;
Thanks.
Yes, seems like that should do the trick. Need to reduce nanos by three orders of magnitude less than you would for seconds to get milliseconds. Accordingly, microseconds would be nanos * 1.0e-3
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| iPhone app remote control tool | DoG | 7 | 3,007 |
Nov 24, 2009 05:27 AM Last Post: DoG |
|
| Is there any iphone app to control presentations? (as powerpoint) | riruilo | 3 | 2,481 |
Oct 13, 2009 03:37 AM Last Post: riruilo |
|

