diff --git a/core/include/sched.h b/core/include/sched.h index 4ca62ff7f7..db3654a634 100644 --- a/core/include/sched.h +++ b/core/include/sched.h @@ -90,7 +90,7 @@ typedef struct { unsigned int laststart; /*< Time stamp of the last time this thread was scheduled to run */ unsigned int schedules; /*< How often the thread was scheduled to run */ - unsigned int runtime; /*< The total runtime of this thread */ + unsigned long runtime; /*< The total runtime of this thread */ } schedstat; /** diff --git a/core/sched.c b/core/sched.c index 85c67a81d6..7c33d81f79 100644 --- a/core/sched.c +++ b/core/sched.c @@ -7,6 +7,8 @@ * Public License. See the file LICENSE in the top level directory for more * details. * + * TODO: setup dependency from SCHEDSTATISTICS to MODULE_HWTIMER + * * @ingroup kernel * @{ * @file @@ -21,6 +23,10 @@ #include #include +#if SCHEDSTATISTICS +#include "hwtimer.h" +#endif + #define ENABLE_DEBUG (0) #include @@ -87,10 +93,8 @@ void sched_run() } -#if SCHEDSTATISTICS - /* TODO: setup dependency from SCHEDSTATISTICS to MODULE_HWTIMER */ - extern unsigned long hwtimer_now(void); - unsigned int time = hwtimer_now(); +#ifdef SCHEDSTATISTICS + unsigned long time = hwtimer_now(); if (my_active_thread && (pidlist[my_active_thread->pid].laststart)) { pidlist[my_active_thread->pid].runtime += time - pidlist[my_active_thread->pid].laststart;