Skip to content

Instantly share code, notes, and snippets.

@laclefyoshi
Created May 21, 2011 03:16
Show Gist options
  • Save laclefyoshi/984197 to your computer and use it in GitHub Desktop.
Save laclefyoshi/984197 to your computer and use it in GitHub Desktop.
get nsec
/**
Copyright: (c) SAEKI Yoshiyasu
License : MIT-style license
<http://www.opensource.org/licenses/mit-license.php>
last updated: 2011/05/21
**/
#include<stdio.h>
#include<stdlib.h>
#include<sys/types.h>
#include<sys/time.h>
int main(int argc, char *argv[]) {
struct timeval tv;
gettimeofday(&tv, NULL);
printf("nsec: %u\n", (uint)tv.tv_usec * 1000);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment