change time measure method (clock() -> gettimeofday())