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

(since you asked for a code review)

For timing benchmarks, use Instant or a similar monotonic clock instead of SystemTime.

The original C code makes the same mistake, using clock_realtime instead of clock_monotonic.

This means the benchmarks will be wrong if the program runs while ntp is fixing up the clock. This can happen right after the system gets internet, or periodically when it checks for skew. Some systems might slowly blend in ntp fixes too, which means 1 second of calendar time is not 1 second of monotonic time over a long period of time.

At least it won't be affected by daylight saving. But it's not airtight



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

Search: