Shuto Naruse
/
Eurobot_2012_Secondary
Eurobot_2012_Secondary
Embed:
(wiki syntax)
Show/hide line numbers
system.cpp
00001 #include "system.h" 00002 00003 float cpupercent; //defining the extern 00004 void measureCPUidle (void const* arg) { 00005 00006 Timer timer; 00007 cpupercent = 0; //defined in system.h 00008 00009 while(1) { 00010 timer.reset(); 00011 timer.start(); 00012 wait(1); // looks like wait uses a RTC 00013 00014 int thistime = timer.read_us()-1000000; 00015 cpupercent = thistime; 00016 } 00017 }
Generated on Sat Jul 16 2022 01:26:17 by 1.7.2