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

I don't really understand how ts_remaining.tv_nsec > 1000000000

could ever be true. I thought we had a-b, with a<1000000000 and b>=0.

For the negative check, the loop should only be able to run once, so could be changed to an 'if' for clarity. Regarding the timing, branching is probably faster.

It is my understanding that the c percent operator can produce a negative number by the way, so your code wouldn't work.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: