implement chrono conversions for unusual duration types
authorAdam Simpkins <simpkins@fb.com>
Fri, 1 Dec 2017 19:18:17 +0000 (11:18 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 1 Dec 2017 19:26:53 +0000 (11:26 -0800)
commit730db44fc0c60c573111449ac7213303f7ed223d
tree3d449caa5812a3c50fb5a5cf8689d1ad5b3c8242
parentf089f1fde3ef52161c6630e8b0e78004af6161ae
implement chrono conversions for unusual duration types

Summary:
Implement conversions between std::chrono::duration and POSIX-style time
structures even when neither the numerator nor the denominator of the duration
ratio are 1.

Both of these are done by first converting to an intermediate type where the
numerator is 1, and then using the conversion routines for that case.

Reviewed By: yfeldblum

Differential Revision: D6366647

fbshipit-source-id: 8f9495fb4101cac6d8b4cf0353a679107007b298
folly/chrono/Conv.h
folly/chrono/test/ConvTest.cpp