Commit 881c4ad4 by Tobias Langer

Fixed problem with wrong timestamp. Now timestamps are printed relative to task start.

parent dfae4598
......@@ -34,8 +34,8 @@ auto calculate_hyperperiod() -> long long
}
struct timestamps {
base_clock::time_point start;
base_clock::time_point end;
cpp_time_base::duration start;
cpp_time_base::duration end;
int core_id = 0;
};
......@@ -59,12 +59,12 @@ void benchmark_out()
std::cout << "executions " << taskset[i].count << std::endl;
for(int j = 0; j < benchmark[i].size(); j++) {
auto start = base_clock::to_time_t(benchmark[i][j].start);
auto end = base_clock::to_time_t(benchmark[i][j].end);
auto task_start = benchmark[i][j].start.count();
auto task_end = benchmark[i][j].end.count();
auto core_id = benchmark[i][j].core_id;
std::cout << "instance " << j << " ";
std::cout << "start " << start << " ";
std::cout << "end " << end << " ";
std::cout << "start " << task_start << " ";
std::cout << "end " << end_task << " ";
std::cout << "core_id " << core_id << std::endl;
}
}
......@@ -112,8 +112,8 @@ static void IdleTask(const void* args, mtapi_size_t, void*, mtapi_size_t,
auto end_time = base_clock::now();
int core_id = sched_getcpu();
benchmark[task_id][task_num - 1].start = start_time;
benchmark[task_id][task_num - 1].end = end_time;
benchmark[task_id][task_num - 1].start = duration_cast<cpp_base_time>(start_time - start);
benchmark[task_id][task_num - 1].end = duration_cast<cpp_base_time>(end_time - start);
benchmark[task_id][task_num - 1].core_id = core_id;
}
......
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 sign in to comment