Skip to content

Instantly share code, notes, and snippets.

@yyl
Created October 7, 2012 17:33
Show Gist options
  • Save yyl/3849017 to your computer and use it in GitHub Desktop.
Save yyl/3849017 to your computer and use it in GitHub Desktop.
os hw1
#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