forked from pyrite-dev/milsko
classic mac os
This commit is contained in:
parent
6f9b3c12a7
commit
5315f4ec4d
34 changed files with 369 additions and 51 deletions
|
|
@ -32,6 +32,27 @@ void MwTimeSleep(int ms) {
|
|||
|
||||
nanosleep(&ts, NULL);
|
||||
}
|
||||
#elif defined(CLASSIC_MAC_OS)
|
||||
static TMTask tm;
|
||||
static int timer;
|
||||
void timerUpdateFunc(void) {
|
||||
timer += 1;
|
||||
PrimeTime((QElemPtr)&tm, 1);
|
||||
};
|
||||
|
||||
long MwTimeGetTick(void) {
|
||||
UnsignedWide h;
|
||||
Microseconds(&h);
|
||||
return *(long*)&h;
|
||||
}
|
||||
void MwTimeSleep(int ms) {
|
||||
tm.tmAddr = NewTimerProc(timerUpdateFunc);
|
||||
tm.tmWakeUp = 0;
|
||||
tm.tmReserved = 0;
|
||||
|
||||
InsTime((QElemPtr)&tm);
|
||||
PrimeTime((QElemPtr)&tm, 1);
|
||||
}
|
||||
#elif defined(__unix__)
|
||||
long MwTimeGetTick(void) {
|
||||
struct timespec ts;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue