From 49451536705a8ebba740f9a7585d94260d933a3e Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 8 Dec 2023 11:24:04 +0800 Subject: [PATCH] 1 --- f8/app.cc | 8 ++++---- f8/app.h | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/f8/app.cc b/f8/app.cc index a5c8790..bf382fa 100644 --- a/f8/app.cc +++ b/f8/app.cc @@ -86,11 +86,11 @@ namespace f8 f8::MsgQueue::Instance()->Update(); DispatchNetMsg(); user_app->Update(delta_time); - Schedule(); a8::tick_t end_tick = a8::XGetTickCount(); - //if (end_tick - begin_tick > PerfMonitor::Instance()->max_run_delay_time) { - //PerfMonitor::Instance()->max_run_delay_time = end_tick - begin_tick; - //} + if (end_tick - begin_tick > max_run_delay_time_) { + max_run_delay_time_ = end_tick - begin_tick; + } + Schedule(); delta_time = end_tick - begin_tick; } UnInit(); diff --git a/f8/app.h b/f8/app.h index 020899b..e142c01 100644 --- a/f8/app.h +++ b/f8/app.h @@ -61,6 +61,8 @@ namespace f8 int GetArgc() { return argc_; } long long GetMsgNodeSize() { return msgnode_size_; } long long GetWorkingMsgNodeSize() { return working_msgnode_size_; } + long long GetMaxRunDelayTime() { return max_run_delay_time_; } + void ResetMaxRunDelayTime() { max_run_delay_time_ = 0; } private: bool Init(); @@ -78,6 +80,7 @@ namespace f8 int exit_code_ = 0; volatile bool terminated_ = false; int nowtime_ = 0; + long long max_run_delay_time_ = 0; int zone_id_ = 0; int node_id_ = 0;