dispatch event intergration
This commit is contained in:
@@ -13,6 +13,7 @@ struct RuntimeEventDispatchResult
|
||||
std::size_t dispatchedEvents = 0;
|
||||
std::size_t handlerInvocations = 0;
|
||||
std::size_t handlerFailures = 0;
|
||||
double dispatchDurationMilliseconds = 0.0;
|
||||
};
|
||||
|
||||
class RuntimeEventDispatcher
|
||||
@@ -56,6 +57,7 @@ public:
|
||||
|
||||
RuntimeEventDispatchResult DispatchPending(std::size_t maxEvents = 0)
|
||||
{
|
||||
const auto startedAt = std::chrono::steady_clock::now();
|
||||
RuntimeEventDispatchResult result;
|
||||
std::vector<RuntimeEvent> events = mQueue.Drain(maxEvents);
|
||||
result.dispatchedEvents = events.size();
|
||||
@@ -78,6 +80,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
result.dispatchDurationMilliseconds =
|
||||
std::chrono::duration<double, std::milli>(std::chrono::steady_clock::now() - startedAt).count();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user