Shuto Naruse
/
Eurobot2012_Secondary
Eurobot2012_Secondary
Fork of Eurobot_2012_Secondary by
Diff: system.cpp
- Revision:
- 0:fbfafa6bf5f9
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/system.cpp Fri Apr 20 21:32:24 2012 +0000 @@ -0,0 +1,17 @@ +#include "system.h" + +float cpupercent; //defining the extern +void measureCPUidle (void const* arg) { + + Timer timer; + cpupercent = 0; //defined in system.h + + while(1) { + timer.reset(); + timer.start(); + wait(1); // looks like wait uses a RTC + + int thistime = timer.read_us()-1000000; + cpupercent = thistime; + } +} \ No newline at end of file