Example #1
0
duration_type overhead_clock()
{
    std::size_t iterations( 10);
    std::vector< boost::uint64_t >  overhead( iterations, 0);
    for ( std::size_t i = 0; i < iterations; ++i)
        std::generate(
            overhead.begin(), overhead.end(),
            clock_overhead() );
    BOOST_ASSERT( overhead.begin() != overhead.end() );
    return duration_type( std::accumulate( overhead.begin(), overhead.end(), 0) / iterations);
}
Example #2
0
int main(void)
{
  tsc_overhead = measure_tsc_overhead();
  clk_overhead = clock_overhead(CLOCK);

  bench_tsc_clock(5);
  bench_tsc_clock(10);
  bench_tsc_clock(25);

  printf("=> Bench code\n");
  bench_syscall();
  bench_fib();

  bench_sleep();

  return 0;
}