src/flb_time.c
int flb_time_msleep(uint32_t ms)
{
#ifdef _MSC_VER
    Sleep((DWORD) ms);
    return 0;
#else
    struct timespec ts;
    ts.tv_sec = ms / 1000;
    ts.tv_nsec = (ms % 1000) * 1000000;
    return nanosleep(&ts, NULL);
#endif
}
/* A portable function to sleep N msec */
A portable function to sleep N msec
A portable function to sleep N msec
int flb_time_msleep(uint32_t ms)
{
#ifdef _MSC_VER
    Sleep((DWORD) ms);
    return 0;
#else
    struct timespec ts;
    ts.tv_sec = ms / 1000;
    ts.tv_nsec = (ms % 1000) * 1000000;
    return nanosleep(&ts, NULL);
#endif
}
int flb_time_msleep ( uint32_t ms ) { #ifdef _MSC_VER Sleep ( ( DWORD ) ms ) ; return 0 ; #else struct timespec ts ; ts . tv_sec = ms / 1000 ; ts . tv_nsec = ( ms % 1000 ) * 1000000 ; return nanosleep ( & ts , NULL ) ; #endif }
A portable function to sleep N msec
A portable function to sleep N msec