OS_CYCLES_TO_NSEC.3p 1.17 KB
.TH OS_CYCLES_TO_NSEC 3P local "Silicon Graphics, Inc."
.SH NAME
.upperok
OS_NSEC_TO_CYCLES, OS_USEC_TO_CYCLES, OS_CYCLES_TO_NSEC, OS_CYCLES_TO_USEC \- convert to, from CPU Count register cycles to nanoseconds or microseconds
.SH SYNOPSIS
.nf
\f3
.Op c
#include <ultra64.h>
.sp .8v
OSTime OS_NSEC_TO_CYCLES(u64 nsecs);
.sp .8v
OSTime OS_USEC_TO_CYCLES(u64 usecs);
.sp .8v
u64 OS_CYCLES_TO_NSEC(OSTime cycles);
.sp .8v
u64 OS_CYCLES_TO_USEC(OSTime cycles);
.Op
\f1
.fi
.SH DESCRIPTION
.I OS_NSEC_TO_CYCLES
and
.I OS_USEC_TO_CYCLES
are
.IR cpp (1)
macros that respectively convert from nanoseconds and microseconds to
CPU Count register cycles.
Conversely,
.I OS_CYCLES_TO_NSEC
and
.I OS_CYCLES_TO_USEC
are macros that respectively convert from CPU Count register cycles to
nanoseconds and microseconds.
.PP
CPU Count register ticks are the units used by the timer services
.IR osGetTime (3P)
and
.IR osSetTimer (3P).
This counter increments at 46.875 Mhz and each counter
tick represents approximately 21.33 nanoseconds.
.PP
Note that all types are 64 bit quantities,
so formatted print functions must use the "%ll" size format to print
these values correctly.
.SH "SEE ALSO"
.IR osGetCount (3P)