Add support for timing C++ snippets. (#47864)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/47864
Test Plan: Imported from OSS
Reviewed By: ngimel
Differential Revision: D25199262
Pulled By: robieta
fbshipit-source-id: 1c2114628ed543fba4f403bf49c065f4d71388e2