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

## osGetTime
osSetTime

Syntax

#include <ultra64.h>
OSTime osGetTime(void);
void osSetTime(OSTime time);
Explanation
The osGetTime and osSetTime functions get and set a real-time counter value. The osGetTime function returns the value of time since the last hard reset. The time is expressed in CPU Count register cycles. For NTSC systems, this counter increments at 45.6375 Mhz and each counter tick represents approximately 21.91 nanoseconds. For PAL systems, this counter increments at 46.5525 Mhz and each counter tick represents approximately 21.48 nanoseconds. When the counter reaches its maximum value, it will roll over to zero and continue.
The osSetTime function sets the real time counter value.
See OS_CYCLES_TO_NSEC for useful macros for converting to and from counter cycle time and nanoseconds or microseconds.
Note that the OSTime type is defined to be u64, so when you use the rmonPrintf tool, specify variables of this type with %llu rather than %i or %u.
See Also
osGetCount
osLogEvent
osSetTimer
osTvType

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