2011-10-07 19:18:23 -03:00
|
|
|
#include <stdio.h>
|
2011-10-09 06:41:03 -03:00
|
|
|
#include <unistd.h>
|
2011-10-07 19:18:23 -03:00
|
|
|
#include <time.h>
|
|
|
|
#include <sys/time.h>
|
|
|
|
|
|
|
|
void setup(void);
|
|
|
|
void loop(void);
|
|
|
|
|
|
|
|
struct timeval sketch_start_time;
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
gettimeofday(&sketch_start_time, NULL);
|
|
|
|
setup();
|
2011-10-09 06:41:03 -03:00
|
|
|
while (true) {
|
2011-10-09 07:22:10 -03:00
|
|
|
struct timespec ts;
|
2011-10-09 06:41:03 -03:00
|
|
|
loop();
|
2011-10-09 07:22:10 -03:00
|
|
|
ts.tv_sec = 0;
|
|
|
|
ts.tv_nsec = 100;
|
|
|
|
nanosleep(&ts, NULL);
|
2011-10-09 06:41:03 -03:00
|
|
|
}
|
2011-10-07 19:18:23 -03:00
|
|
|
return 0;
|
|
|
|
}
|