Beispiel #1
0
UHUGEINTVAL Parrot_hires_get_time(void)
{
    struct timespec ts;
    struct timeval  tv;
    gettimeofday(&tv, NULL);

    ts.tv_sec = tv.tv_sec;
    ts.tv_nsec = tv.tv_usec * 1000;

    return TIME_IN_NS(ts);
}
Beispiel #2
0
UHUGEINTVAL Parrot_hires_get_time(void)
{
    struct timespec ts;
#if _POSIX_TIMERS
    clock_gettime(CLOCK_BEST, &ts);
#else
    struct timeval  tv;
    gettimeofday(&tv, NULL);

    ts.tv_sec = tv.tv_sec;
    ts.tv_nsec = tv.tv_usec * 1000;
#endif
    return TIME_IN_NS(ts);
}