.\" the source, must acknowledge the copyright and authors of this work.
.\" %%%LICENSE_END
.\"
-.TH __PPC_GET_TIMEBASE 3 2015-07-23 "GNU C Library" "Linux Programmer's\
+.TH __PPC_GET_TIMEBASE 3 2019-03-06 "GNU C Library" "Linux Programmer's\
Manual"
.SH NAME
__ppc_get_timebase, __ppc_get_timebase_freq \- get the current value
.B #include <sys/platform/ppc.h>
.PP
.BI "uint64_t __ppc_get_timebase(void)"
-
+.PP
.BI "uint64_t __ppc_get_timebase_freq(void);"
.SH DESCRIPTION
.BR __ppc_get_timebase ()
value, while
.BR __ppc_get_timebase_freq ()
returns the frequency in which the Time Base Register is updated.
-
+.PP
The Time Base Register is a 64-bit register provided by Power Architecture
processors.
It stores a monotonically incremented value that is updated at a
.BR __ppc_get_timebase ()
returns a 64-bit unsigned integer that represents the current value of the
Time Base Register.
-
+.PP
.BR __ppc_get_timebase_freq ()
returns a 64-bit unsigned integer that represents the frequency at
which the Time Base Register is updated.
.BR __ppc_get_timebase ().
.SS Program source
\&
-.nf
+.EX
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
uint64_t tb1, tb2, diff;
uint64_t freq = __ppc_get_timebase_freq();
- printf("Time Base frequency = %"PRIu64" Hz\\n", freq);
+ printf("Time Base frequency = %"PRIu64" Hz\en", freq);
tb1 = __ppc_get_timebase();
diff = (MAX_TB \- tb2) + tb1;
}
- printf("Elapsed time = %1.2f usecs\\n",
+ printf("Elapsed time = %1.2f usecs\en",
(double) diff * 1000000 / freq );
exit(EXIT_SUCCESS);
}
-.fi
+.EE
.SH SEE ALSO
.BR time (2),
.BR usleep (3)