How to read the Pentium's high-res. counter for accurate time measurement?

From: hires (hr)
Date: 05/29/04


Date: Sat, 29 May 2004 22:03:22 +1000

Following code can be used in Windows to measure time accuratelly by using
the Pentium's internal high-res counter.
How to perform this in Linux?

//--------------------------------------------------
QueryPerformanceFrequency(&c);

QueryPerformanceCounter(&t1); // Start point
    //--------------------------------------------------
    Do Something here . . .
    //--------------------------------------------------
QueryPerformanceCounter(&t2); // Stop point

ElapsedTimeInSeconds = (((long double)t2.QuadPart - (long
double)t1.QuadPart) / (long double)c.QuadPart);
//--------------------------------------------------