]> git.tdb.fi Git - libs/core.git/commitdiff
Fix a sign error in ProfilingScope
authorMikko Rasa <tdb@tdb.fi>
Sun, 11 Nov 2007 19:27:59 +0000 (19:27 +0000)
committerMikko Rasa <tdb@tdb.fi>
Sun, 11 Nov 2007 19:27:59 +0000 (19:27 +0000)
Add TICK_BUSY mode to Application

source/core/application.cpp
source/core/application.h
source/debug/profilingscope.cpp

index e1a93141480c9cf3459c483d5b66c5440529703b..c93475fea972e84985f82acfb08fb030018407bd 100644 (file)
@@ -133,6 +133,8 @@ int Application::main()
                        sched_yield();
 #endif
                }
+               else if(loop_mode_==TICK_BUSY)
+                       tick();
        }
 
        return exit_code;
index 81569ad45a965ad85c165a7eb5914f360be3f9a7..bd433aafcc3fb16dfd0e0d1bc51c435f6bf5adab 100644 (file)
@@ -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
index f92749b214f588357c38baa22f53960973aa9fdd..edf1aa3de975ed0361333d448723fe24ce9e07bb 100644 (file)
@@ -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;