Skip to content

Instantly share code, notes, and snippets.

@nicwolff
Created February 13, 2015 17:51
Show Gist options
  • Select an option

  • Save nicwolff/04c270c70bde89ee3815 to your computer and use it in GitHub Desktop.

Select an option

Save nicwolff/04c270c70bde89ee3815 to your computer and use it in GitHub Desktop.
Compile little precise-time program
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