time_t
just stores seconds, so
time_t time = (time_t)ut_tv.tv_sec;
Should work, but since you're just looking for a difference, there's always the magic of subtraction.
struct timeval diff = {a.tv_sec-b.tv_sec, a.tv_usec-b.tv_usec};
This lets you keep all the precision you had before.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…