[bench] Use higher resolution timer on POSIX
authorNick Terrell <terrelln@fb.com>
Tue, 17 Oct 2017 19:42:27 +0000 (12:42 -0700)
committerNick Terrell <terrelln@fb.com>
Tue, 17 Oct 2017 20:55:35 +0000 (13:55 -0700)
commit74d8688bc8104d897f9c98fc747400e71fbe77bc
tree65746f0db5851cb86a956886faadfdc1abfd49c6
parentdccf8826f1d76efcbdc655e63cc04cdbd1123619
[bench] Use higher resolution timer on POSIX

The timer used was only accurate up to 0.01 seconds. This timer is accurate up to 1 ns.
It is a monotonic timer that measures the real time difference, not on CPU time.

Copied the benchmark code from https://github.com/facebook/zstd/commit/6ab4d5e9041aba962a810ffee191f95897c6208e
programs/bench.c
programs/util.h