Logo Search packages:      
Sourcecode: pulseaudio version File versions  Download package

struct timeval* pa_timeval_add ( struct timeval *  tv,
pa_usec_t  v 
) [read]

Add the specified time inmicroseconds to the specified timeval structure

Definition at line 132 of file timeval.c.

                                                                {
    unsigned long secs;
    pa_assert(tv);

    secs = (unsigned long) (v/PA_USEC_PER_SEC);
    tv->tv_sec += secs;
    v -= ((pa_usec_t) secs) * PA_USEC_PER_SEC;

    tv->tv_usec += (suseconds_t) v;

    /* Normalize */
    while (tv->tv_usec >= PA_USEC_PER_SEC) {
        tv->tv_sec++;
        tv->tv_usec -= PA_USEC_PER_SEC;
    }

    return tv;
}


Generated by  Doxygen 1.6.0   Back to index