How to read the Pentium's high-res. counter for accurate time measurement?
From: hires (hr)
Date: 05/29/04
- Next message: Nils O. Selåsdal: "Re: RH 7.3 backwards compatibility (from RH 9)"
- Previous message: Måns Rullgård: "Re: PHP vs. Java+ [Re: Good open-source CMS packages, etc.?]"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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);
//--------------------------------------------------
- Next message: Nils O. Selåsdal: "Re: RH 7.3 backwards compatibility (from RH 9)"
- Previous message: Måns Rullgård: "Re: PHP vs. Java+ [Re: Good open-source CMS packages, etc.?]"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]