#include <sys/time.h>
#include <time.h>
static void print_elapsedTime()
{
struct timeval tv;
static long prev;
long curr;
gettimeofday(&tv, NULL);
curr = tv.tv_sec * 1000LL + tv.tv_usec / 1000;
LOGD("elapsed time (ms) : %d (%d fps)", curr-prev, 1000/(curr-prev));
prev = curr;
}