Created
October 7, 2012 17:33
-
-
Save yyl/3849017 to your computer and use it in GitHub Desktop.
os hw1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/time.h> | |
/* will return current time in second format */ | |
double get_seconds() { | |
struct timeval tim; | |
gettimeofday(&tim, NULL); | |
double t1=tim.tv_sec+(tim.tv_usec/1000000.0); | |
return t1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment