From: Mikko Rasa Date: Sun, 11 Nov 2007 19:27:59 +0000 (+0000) Subject: Fix a sign error in ProfilingScope X-Git-Tag: 1.0~14 X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=ce8b99f8d48b7783fd97f3959198f9c54cebec72;p=libs%2Fcore.git Fix a sign error in ProfilingScope Add TICK_BUSY mode to Application --- 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;