コード例 #1
0
ファイル: my_rdtsc-t.c プロジェクト: jeppeter/mysql56
void test_nanosecond()
{
  ulonglong t1= my_timer_nanoseconds();
  ulonglong t2;
  int i;
  int backward= 0;
  int nonzero= 0;

  for (i=0 ; i < LOOP_COUNT ; i++)
  {
    t2= my_timer_nanoseconds();
    if (t1 > t2)
      backward++;
    if (t2 != 0)
      nonzero++;
    t1= t2;
  }

  ok((backward == 0), "The nanosecond timer is increasing");

  if (myt.nanoseconds.routine != 0)
    ok((nonzero != 0), "The nanosecond timer is implemented");
  else
    ok((nonzero == 0), "The nanosecond timer is not implemented and returns 0");
}
コード例 #2
0
ファイル: chassis-timings.c プロジェクト: api1024/DBProxy
guint64 chassis_get_rel_nanoseconds() {
    return my_timer_nanoseconds();
}