Commit 7c106519 authored by Joanne Hugé's avatar Joanne Hugé

Remove IO during measurements

parent d9ef8c97
......@@ -93,6 +93,8 @@ static void *timerthread(void *p) {
next = add_ns(current, param->interval);
}
printf("Done\n");
return NULL;
}
......@@ -134,7 +136,7 @@ int main(int argc, char *argv[]) {
main_param_t main_param;
// Default values
param.interval = NSECS_PER_SECOND;
param.interval = 1000000;
param.max_cycles = 100;
param.priority = 80;
......@@ -142,21 +144,26 @@ int main(int argc, char *argv[]) {
process_options(argc, argv, &param, &main_param);
int err =
pthread_create(&thread, NULL, timerthread, (void *)&param);
sleep(3);
if(err)
error(EXIT_FAILURE, errno, "Couldn't create thread");
pthread_create(&thread, NULL, timerthread, (void *)&param);
for (;;) {
sleep(10);
usleep(main_param.refresh_rate);
printf("Maximum latency: %" PRIi64 "us (%d)\n", (param.stat.max_diff / 1000), param.stat.nb_cycles);
printf("Maximum latency: %" PRIi64 "us (%d)\n", (param.stat.max_diff / 1000), param.stat.nb_cycles);
//if(err)
// error(EXIT_FAILURE, errno, "Couldn't create thread");
if( param.max_cycles == param.stat.nb_cycles )
break;
}
//for (;;) {
// usleep(main_param.refresh_rate);
// printf("Maximum latency: %" PRIi64 "us (%d)\n", (param.stat.max_diff / 1000), param.stat.nb_cycles);
// if( param.max_cycles == param.stat.nb_cycles )
// break;
//}
exit(EXIT_SUCCESS);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment