Commit 17b5906f authored by Thanassis Tsiodras's avatar Thanassis Tsiodras

Timing experiments

parent 11993f41
......@@ -22,6 +22,13 @@ rtems_task Init(rtems_task_argument argument)
rtems_id Task_id[TASKS]; /* task ids */
int i;
rtems_interval t1, t2;
clock_t ot1, ot2;
uint64_t oot1, oot2;
t1 = rtems_clock_get_ticks_since_boot();
ot1 = clock();
oot1 = rtems_clock_get_uptime_nanoseconds();
g_init_task_id = rtems_task_self();
for(i = 0; i < TASKS; i++)
{
......@@ -69,8 +76,15 @@ rtems_task Init(rtems_task_argument argument)
printf("[PARENT] All tasks completed.\n");
fflush(stdout);
}
oot2 = rtems_clock_get_uptime_nanoseconds();
ot2 = clock();
t2 = rtems_clock_get_ticks_since_boot();
printf("[-] Took: %u\n", (unsigned int)(t2-t1));
printf("[-] Took: %u\n", (unsigned int)(ot2-ot1));
printf("[-] Took: %llu\n", oot2-oot1);
#ifdef COVERAGE_ENABLED
__gcov_exit();
#endif
exit(0);
// exit(0);
rtems_shutdown_executive(0);
}
......@@ -6,9 +6,15 @@ rtems_task Task1_EntryPoint(rtems_task_argument argument)
int task_no = (int) argument;
task_begin(task_no);
double a = 1.79769313486e+308;
printf("BIG: %f\n", a);
printf("BIGGER: %f\n", a/0.2);
printf("What is 1.0/max? %f\n", (1.0/a));
printf("What is 0.0/0.0? %f\n", (0.0/(1.0/a)));
int j;
double d=task_no;
for(j=0; j<10000; j++) {
for(j=0; j<100; j++) {
int k;
for(k=0; k<10000; k++)
d+=1.001;
......
......@@ -8,7 +8,7 @@ rtems_task Task2_EntryPoint(rtems_task_argument argument)
int j;
long long int dummy = 0;
for(j=0; j<500000; j++) {
for(j=0; j<5000; j++) {
int k;
for(k=0; k<100; k++)
dummy ^= k;
......
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