diff --git a/f8/app.cc b/f8/app.cc index 549cd54..2cda953 100644 --- a/f8/app.cc +++ b/f8/app.cc @@ -79,6 +79,7 @@ namespace f8 user_app_ = user_app; int delta_time = 0; if (Init()) { + a8::tick_t last_stat_tick = a8::XGetTickCount(); while (!Terminated()) { a8::tick_t begin_tick = a8::XGetTickCount(); nowtime_ = time(nullptr); @@ -92,7 +93,12 @@ namespace f8 } Schedule(); end_tick = a8::XGetTickCount(); - delta_time = end_tick - begin_tick; + if (end_tick - last_stat_tick > 0) { + delta_time = end_tick - last_stat_tick; + last_stat_tick = end_tick; + } else { + delta_time = 0; + } } UnInit(); }