N64® Functions Menu

al - Audio Library Functions
gDP - DP GBI Macros
gdSP - General GBI Macros
gSP - SP GBI Macros
gt - Turbo Microcode RDP
gu - Graphics Utilities
Math - Math Functions
nuSys - NuSystem
os - N64 Operating System
sp - Sprite Library Functions
uh - Host to Target IO
64DD - N64 Disk Drive

Nintendo® Confidential

## OS_NSEC_TO_CYCLES

Syntax
#include <ultra64.h>
OSTime OS_NSEC_TO_CYCLES(u64 nsecs);
Arguments

- nsecs is the number of nanoseconds to convert to CPU count register cycles

Return Value
The number of CPU count register cycles
Explanation
The macros OS_NSEC_TO_CYCLES, OS_USEC_TO_CYCLES, OS_CYCLES_TO_NSEC, and OS_CYCLES_TO_USEC convert to/from CPU Count register cycles from/to nanoseconds or microseconds.
OS_NSEC_TO_CYCLES and OS_USEC_TO_CYCLES are cpp(1) macros that respectively convert from nanoseconds and microseconds to CPU Count register cycles. Conversely, OS_CYCLES_TO_NSEC and OS_CYCLES_TO_USEC are macros that respectively convert from CPU Count register cycles to nanoseconds and microseconds.
CPU Count register ticks are the units used by the timer services osGetTime and osSetTimer. This counter increments at 46.875 Mhz and each counter tick represents approximately 21.33 nanoseconds.
Note that all types are 64-bit quantities, so formatted print functions must use the "%ll" size format to print these values correctly.
See Also
OS_USEC_TO_CYCLES
OS_CYCLES_TO_USEC
OS_CYCLES_TO_NSEC
osGetCount

Nintendo® Confidential Warning: all information in this document is confidential and covered by a non-disclosure agreement. You are responsible for keeping this information confidential and protected. Nintendo will vigorously enforce this responsibility.
Copyright © 1998
Nintendo of America Inc. All rights reserved
Nintendo and N64 are registered trademarks of Nintendo
Last updated March 1998