Beispiel #1
0
static int
do_test (void)
{
  uint64_t t1, t2, f, diff;

  t1 = __ppc_get_timebase ();
  printf ("t1 = %"PRIu64"\n", t1);

  f = __ppc_get_timebase_freq ();
  printf ("Time Base frequency = %"PRIu64" Hz\n", f);

  if (f == 0) {
      printf ("Fail: The time base frequency can't be zero.");
      return 1;
  }

  t2 = __ppc_get_timebase ();
  printf ("t2 = %"PRIu64"\n", t2);

  if (t2 > t1) {
    diff = t2 - t1;
  } else {
    diff = (MAX_TB - t2) + t1;
  }

  printf ("Elapsed time  = %1.2f usecs\n", (double) diff * 1000000 / f );

  return 0;
}
static int
do_test (void)
{
  uint64_t t1, t2, t3;
  t1 = __ppc_get_timebase ();
  printf ("Time Base = %"PRIu64"\n", t1);
  t2 = __ppc_get_timebase ();
  printf ("Time Base = %"PRIu64"\n", t2);
  t3 = __ppc_get_timebase ();
  printf ("Time Base = %"PRIu64"\n", t3);
  if (t1 != t2 && t1 != t3 && t2 != t3)
    return 0;

  printf ("Fail: timebase reads should always be different.");
  return 1;
}
Beispiel #3
0
void testValues() {
    f = 2;
    
    __ppc_get_timebase();

    //@ assert f == 2;
    //@ assert vacuous: \false;
}
Beispiel #4
0
void runSuccess() {
    __ppc_get_timebase();
}