Skip to content

Instantly share code, notes, and snippets.

@erichschroeter
Created October 17, 2014 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erichschroeter/499505824efcb23bc3fb to your computer and use it in GitHub Desktop.
Save erichschroeter/499505824efcb23bc3fb to your computer and use it in GitHub Desktop.
timestamp
#include <stdio.h>
#include <time.h>
void ptimestamp_micro(struct timespec *now, char *text)
{
long us = (now->tv_sec * 1000000) + (now->tv_nsec / 1000);
printf("%ld%s", us, text);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment