summaryrefslogtreecommitdiff
path: root/soh/src/libultra/os/gettime.c
blob: 2ca90b0df99299d29dc0a385fc498b345eabecd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "global.h"

OSTime osGetTime(void) {
    u32 count;
    u32 base;
    OSTime t;
    register u32 prevInt = __osDisableInt();

    count = osGetCount();
    base = count - __osBaseCounter;
    t = __osCurrentTime;
    __osRestoreInt(prevInt);

    return base + t;
}