Created
February 13, 2015 17:51
-
-
Save nicwolff/04c270c70bde89ee3815 to your computer and use it in GitHub Desktop.
Compile little precise-time program
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
| cat | cc -xc -o time - | |
| #include <stdio.h> | |
| #include <sys/time.h> | |
| int main(void) | |
| { | |
| struct timeval time_now; | |
| gettimeofday(&time_now,NULL); | |
| printf ("%ld secs, %d usecs\n",time_now.tv_sec,time_now.tv_usec); | |
| return 0; | |
| } | |
| ^d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment