osGetTime.3p
1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
.TH osGetTime 3P local "Silicon Graphics, Inc."
.SH NAME
.upperok
osGetTime, osSetTime \- get, set real time counter value
.SH SYNOPSIS
.nf
\f3
.Op c
#include <ultra64.h>
.sp .8v
OSTime osGetTime(void);
.sp .8v
void osSetTime(OSTime time);
.Op
\f1
.fi
.SH DESCRIPTION
The
.I osGetTime
call 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
.I osSetTime
call is used to set the real time counter value.
.sp
See
.IR OS_CYCLES_TO_NSEC (3P)
for useful macros for converting to and from counter cycle time and
nanoseconds or microseconds.
.sp
Note that the
.I OSTime
type is defined to be
.I u64
and so when using
.I rmonPrintf,
variables of this type must be specified with %llu rather than %i or %u.
.SH "SEE ALSO"
.IR osGetCount (3P),
.IR osLogEvent (3P),
.IR osSetTimer (3P),
.IR osTvType (3P)