use clock_gettime() instead of gettimeofday()
let flu_msleep() return the remaining ms to sleep