#include <iostream>
#include <iomanip>
#include <time.h>
#include <sys/time.h>
using namespace std;
int main ()
{
unsigned long a, d, prevd;
struct timeval tv;
prevd = 0;
for (;;) {
asm volatile("rdtsc":"=a" (a), "=d" (d));
gettimeofday (&tv, 0);
if (d != prevd) {
cout << setfill(' ') << d << " " << setw(11) << a
<< setw(12) << tv.tv_sec << "."
<< setw(6) << setfill('0') << tv.tv_usec << endl;
prevd = d;
}
}
}