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

> he correct solution is to use a monotonically increasing time function, such Linux’s clock_gettime() or OS X’s mach_absolute_time().

At the expense of supporting FEWER platforms.



Another #ifdef would fix that!

A wrapper function could hide the extra #ifdef, taking it out of OP's count. A macro defined during compilation would be even better|harder to understand.




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

Search: