From ce8b99f8d48b7783fd97f3959198f9c54cebec72 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 11 Nov 2007 19:27:59 +0000 Subject: [PATCH] Fix a sign error in ProfilingScope Add TICK_BUSY mode to Application --- source/core/application.cpp | 2 ++ source/core/application.h | 3 ++- source/debug/profilingscope.cpp | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/source/core/application.cpp b/source/core/application.cpp index e1a9314..c93475f 100644 --- a/source/core/application.cpp +++ b/source/core/application.cpp @@ -133,6 +133,8 @@ int Application::main() sched_yield(); #endif } + else if(loop_mode_==TICK_BUSY) + tick(); } return exit_code; diff --git a/source/core/application.h b/source/core/application.h index 81569ad..bd433aa 100644 --- a/source/core/application.h +++ b/source/core/application.h @@ -28,7 +28,8 @@ protected: NONE, /// No main loop - main() will just return SLEEP, /// Only sleep in the main loop - useful for servers TICK_SLEEP, /// Call tick every iteration, with a short sleep in between - TICK_YIELD /// Call tick every iteration, with sched_yield in between + TICK_YIELD, /// Call tick every iteration, with sched_yield in between + TICK_BUSY /// Call tick every iteration }; class RegBase diff --git a/source/debug/profilingscope.cpp b/source/debug/profilingscope.cpp index f92749b..edf1aa3 100644 --- a/source/debug/profilingscope.cpp +++ b/source/debug/profilingscope.cpp @@ -15,7 +15,7 @@ ProfilingScope::ProfilingScope(Profiler &p, const string &n): ProfilingScope::~ProfilingScope() { - const Time::TimeDelta dt=start_t-Time::now(); + const Time::TimeDelta dt=Time::now()-start_t; if(parent) { parent->child_t+=dt; -- 2.43.0