Пример #1
0
static frame_time_t machdep_morphos_gettimebase (void)
{
    UQUAD cputime;

    frame_time_t result = ReadCPUClock (&cputime);

    return result;
}
Пример #2
0
void timer_gettime(void *t, struct timeval *tv)
{
    struct timer_s *timer = t;

    if (timer != NULL) {
        UQUAD ticks;
        ULONG base;

#define TimerBase timer->TimerBase
        base = ReadCPUClock(&ticks);
#undef TimerBase
        tv->tv_secs  = ticks / base;
        tv->tv_micro = 1000000 * (ticks % base) / base;
    }
}