Make AutoTimer work with std::chrono::duration instead of seconds with type double
authorAravind Anbudurai <aru7@fb.com>
Fri, 1 Jul 2016 17:10:43 +0000 (10:10 -0700)
committerFacebook Github Bot 5 <facebook-github-bot-5-bot@fb.com>
Fri, 1 Jul 2016 17:23:26 +0000 (10:23 -0700)
commit0b14cc4f48bebe930814601f9c11e01ec733bf81
tree5ffa75ede45092dd8df9a15e9f6bc1a8ecbfc906
parentca33aa316c3e90f68b52a79188ca6da508b5b51b
Make AutoTimer work with std::chrono::duration instead of seconds with type double

Summary:
Currently, AutoTimer outputs duration as a double with seconds as units.
This is limiting and I'm making it return std::chrono::duration. Users can specify the type with DurationType.

This is needed for me because the library that I am going to use inside the callback I pass in using chrono::duration and it feels hacky to go from duration -> double -> duration.

Reviewed By: yfeldblum

Differential Revision: D3506557

fbshipit-source-id: 0a5e9e16181bfac3a10df6a253716c0499cff5df
folly/experimental/AutoTimer.h
folly/experimental/test/AutoTimerTest.cpp