modify some functions about timeval structure