File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -191,7 +191,6 @@ namespace NActors {
191191 Ctx.HPStart = GetCycleCountFast ();
192192 Ctx.ExecutedEvents = 0 ;
193193 }
194- NHPTimer::STime hpprev = Ctx.HPStart ;
195194
196195 IActor* actor = nullptr ;
197196 const std::type_info* actorType = nullptr ;
@@ -200,10 +199,14 @@ namespace NActors {
200199 bool firstEvent = true ;
201200 bool preempted = false ;
202201 bool wasWorking = false ;
202+ NHPTimer::STime hpnow = Ctx.HPStart ;
203+ NHPTimer::STime hpprev = TlsThreadContext->StartOfElapsingTime .exchange (hpnow, std::memory_order_acq_rel);
204+ Ctx.AddElapsedCycles (ActorSystemIndex, hpnow - hpprev);
205+ hpprev = Ctx.HPStart ;
206+
203207 for (; Ctx.ExecutedEvents < Ctx.EventsPerMailbox ; ++Ctx.ExecutedEvents ) {
204208 if (TAutoPtr<IEventHandle> evExt = mailbox->Pop ()) {
205209 mailbox->ProcessEvents (mailbox);
206- NHPTimer::STime hpnow;
207210 recipient = evExt->GetRecipientRewrite ();
208211 TActorContext ctx (*mailbox, *this , hpprev, recipient);
209212 TlsActivationContext = &ctx; // ensure dtor (if any) is called within actor system
You can’t perform that action at this time.
0 commit comments