Skip to content

Commit

Permalink
Expose timepoint at the start of EventBase loop callbacks
Browse files Browse the repository at this point in the history
Summary: This is useful to separate out idle time from the evb loop time.

Reviewed By: yfeldblum

Differential Revision: D46956487

fbshipit-source-id: fbf99b15b8b8c22df65f77b9624543d7b0a999bf
  • Loading branch information
Udip Pant authored and facebook-github-bot committed Jun 25, 2023
1 parent 9bd57cd commit 468d81a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions folly/io/async/EventBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,13 @@ class EventBase : public TimeoutManager,
*/
std::thread::id getLoopThreadId();

/**
* Returns the timepoint at the start of the loop callbacks.
*/
std::chrono::steady_clock::time_point getLoopCallbacksStartTime() {
return startWork_;
}

/// Implements the Executor interface
void add(Cob fn) override { runInEventBaseThread(std::move(fn)); }

Expand Down

0 comments on commit 468d81a

Please sign in to comment.