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

## osSetTimer
osStopTimer

Syntax

    #include <ultra64.h>
    int osSetTimer(OSTimer *timer, OSTime countdown, OSTime interval,
                            OSMesgQueue *mq, OSMesg msg);
    void osStopTimer(OSTimer *timer);
    void osStopTimer(OSTimer *timer);

Explanation
The osSetTimer and osStopTimer functions start and stop an interval or countdown timer.
The osSetTimer function sets the value for the timer specified by the timer argument. This call supports both countdown timers and interval timers. If the countdown argument is non-zero, it indicates the time to the next timer expiration. If the interval argument is non-zero, it specifies a value to be used in reloading the timer when the timer expires. The message specified by the msg argument is copied to the end of the given message queue (pointed to by the mq argument) when the timer expires. The osSetTimer function always returns 0.
The osStopTimer function stops the specified interval timer. There is no need to call osStopTimer if only the countdown timer is enabled in the osSetTimer call.
Both countdown and interval are expressed in CPU Count register cycles. This counter increments at 46.875 Mhz and each counter tick represents approximately 21.33 nanoseconds. See OS_CYCLES_TO_NSEC for useful macros for converting to and from counter cycle time and nanoseconds or microseconds.
Note
To avoid a reduction in overall system performance, do not set time values to fewer than 50 microseconds.
See Also
osGetTime

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