| |
| Using the WIN API high resolution performance counter |
 |
How can I make use of the high resolution performance counter available under Win32?
The following example demonstrates using the TLargeInteger type to query the performance counter. Note that the TLargeInteger type (64 bit integer) can be converted and referenced as a whole by casting it to a Comp type.
Example:procedure TForm .Button Click(Sender: TObject);
var
li : TLARGEINTEGER;
begin
QueryPerformanceFrequency(li);
ShowMessage(FloatToStr(Comp(li)));
QueryPerformanceCounter(li);
ShowMessage(FloatToStr(Comp(li)));
QueryPerformanceCounter(li);
ShowMessage(FloatToStr(Comp(li)));
end;
|
|
| Hits/month |
2,500,000+ |
Downloads (Since May 2000) |
7,393,709 |
| Total Files |
6,023 |
| Forum msgs |
7,670 |
| Articles/FAQs |
70+/900+ |
Top Selling Software at Amazon
|