osGetCount.3p
959 Bytes
.TH osGetCount 3P local "Silicon Graphics, Inc."
.SH NAME
.upperok
osGetCount \- get CPU Count register
.SH SYNOPSIS
.nf
\f3
.Op c
#include <ultra64.h>
.sp .8v
u32 osGetCount(void);
.Op
\f1
.fi
.SH DESCRIPTION
The
.I osGetCount
routine returns the current value of the MIPS R4300 Count register,
a free running counter that increments at half the CPU clock speed.
This counter increments at 46.875 Mhz and each counter
tick represents approximately 21.33 nanoseconds.
When the counter reaches its maximum value,
it will roll over to zero and continue.
Since the counter is 32 bits long, the counter will wrap approximately every
92 seconds.
See
.IR OS_CYCLES_TO_NSEC (3P)
for useful macros for converting to and from counter cycle time and
nanoseconds or microseconds.
.PP
The counter value may be used as a pseudo-random number generator or
for short duration timing purposes.
.SH "SEE ALSO"
.IR OS_CYCLES_TO_NSEC (3P),
.IR osTvType (3P),
.IR osGetTime (3P)