Skip to content

Instantly share code, notes, and snippets.

@laclefyoshi
Created May 21, 2011 03:05
Show Gist options
  • Save laclefyoshi/984186 to your computer and use it in GitHub Desktop.
Save laclefyoshi/984186 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<time.h>
int main(int argc, char *argv[]) {
struct timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
printf("nsec: %u\n", (uint)ts.tv_nsec);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment