Skip to content

Commit

Permalink
Add microsecond logging support
Browse files Browse the repository at this point in the history
Summary: Microseconds at TimePoint are also useful

Reviewed By: shodoco

Differential Revision: D19291914

fbshipit-source-id: 1318a24a186a6a42a84a1627a93f0aa449eec8f4
  • Loading branch information
Felix Merk authored and facebook-github-bot committed Jan 14, 2020
1 parent d344863 commit f45504b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions proxygen/lib/utils/Time.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ inline std::chrono::seconds secondsSinceEpoch() {
std::chrono::system_clock::now().time_since_epoch());
}

inline std::chrono::microseconds microsecondsSinceEpoch(TimePoint t) {
return std::chrono::duration_cast<std::chrono::microseconds>(
toSystemTimePoint(t).time_since_epoch());
}

inline std::chrono::milliseconds millisecondsSinceEpoch(TimePoint t) {
return std::chrono::duration_cast<std::chrono::milliseconds>(
toSystemTimePoint(t).time_since_epoch());
Expand Down

0 comments on commit f45504b

Please sign in to comment.