Wrappers folly::chrono::clock_gettime and clock_gettime_ns
authorChristopher Dykes <cdykes@fb.com>
Tue, 19 Jul 2016 22:58:01 +0000 (15:58 -0700)
committerFacebook Github Bot 8 <facebook-github-bot-8-bot@fb.com>
Tue, 19 Jul 2016 23:08:29 +0000 (16:08 -0700)
commit5ab482b114b9872530b297e30bf1dde404848dbe
tree4f928cb592b21a7668f5e633f19b6d5918867591
parent4786b768ae52b3a80ca3eb29383937dc1910035d
Wrappers folly::chrono::clock_gettime and clock_gettime_ns

Summary:
On Linux hosts, the fast path to get the current time in
nanoseconds without doing a syscall to the kernel is available via the
VDSO kernel-runtime interface.

In this diff, I:

1. Expose portability wrappers `folly::chrono::clock_gettime()` and
`folly::chrono::clock_gettime_ns()`
2. Implement a VDSO wrapper on Linux hosts to implement those without
a round-trip to the kernel

Depends On D3418054

Reviewed By: bmaurer

Differential Revision: D3418087

fbshipit-source-id: 3fb99f0dd946f19ba29d0d52a1038dad3556bafd
folly/ClockGettimeWrappers.cpp [new file with mode: 0644]
folly/ClockGettimeWrappers.h [new file with mode: 0644]
folly/Makefile.am
folly/test/ClockGettimeWrappersTest.cpp [new file with mode: 0644]
folly/test/Makefile.am