double d = 2.34089; struct timeval tv; tv.tv_sec = (int)d; tv.tv_usec = (int)((double)(((double)d-(int)d)*1000000))