summaryrefslogtreecommitdiffstats
path: root/man3/__ppc_get_timebase.3
diff options
context:
space:
mode:
Diffstat (limited to 'man3/__ppc_get_timebase.3')
-rw-r--r--man3/__ppc_get_timebase.318
1 files changed, 9 insertions, 9 deletions
diff --git a/man3/__ppc_get_timebase.3 b/man3/__ppc_get_timebase.3
index ec7204191..d796ca077 100644
--- a/man3/__ppc_get_timebase.3
+++ b/man3/__ppc_get_timebase.3
@@ -60,36 +60,36 @@ between two calls to
#include <stdio.h>
#include <stdlib.h>
#include <sys/platform/ppc.h>
-
+\&
/* Maximum value of the Time Base Register: 2\[ha]60 \- 1.
Source: POWER ISA. */
#define MAX_TB 0xFFFFFFFFFFFFFFF
-
+\&
int
main(void)
{
uint64_t tb1, tb2, diff;
uint64_t freq;
-
+\&
freq = __ppc_get_timebase_freq();
printf("Time Base frequency = %"PRIu64" Hz\en", freq);
-
+\&
tb1 = __ppc_get_timebase();
-
+\&
// Do some stuff...
-
+\&
tb2 = __ppc_get_timebase();
-
+\&
if (tb2 > tb1) {
diff = tb2 \- tb1;
} else {
/* Treat Time Base Register overflow. */
diff = (MAX_TB \- tb2) + tb1;
}
-
+\&
printf("Elapsed time = %1.2f usecs\en",
(double) diff * 1000000 / freq);
-
+\&
exit(EXIT_SUCCESS);
}
.EE