fixed timeval for sim.c