#include <stdio.h>
#include <unistd.h>

#define timestamp() \
    ({ \
        unsigned long long low = 0, high = 0; \
        asm volatile ("rdtsc\n" \
                      "movl %%eax, %0\n" \
                      "movl %%edx, %1\n" : "=r"(low), "=r"(high)); \
        (unsigned long long) (high << 32) | (low); \
    })

int main(int argc, char **argv)
{
    unsigned long long t1 = 0, t2 = 0;

    t1 = timestamp();
    pid_t p = getpid();
    t2 = timestamp();
    
    printf("Ticks: %u\n", t2 - t1);
    return 0;
}

