Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's a similar situation on iOS, where new developers sometimes use (in Objective-C) `[[NSDate date] timeIntervalSince1970]` which is natural, but wrong. NSDate draws from the network synchronized clock and will occasionally hiccup when re-synching it against the network, among other reasons.

If you're looking at measuring relative timing (for example for games or animation), you should instead use `double currentTime = CACurrentMediaTime();` That's the correct way.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: