QueryPerformanceFrequency Timer:
// Take the system level time accuracy: varc1: int64; t1, t2: int64; r1: double; begin queryperformancefrequency (c1); // First call, get the clock crystal frequency queryperformancecounter (t1); // windows API Get Start counting value SLEEP (1000); {DO ...} // execute the code QueryperFormanceCounter (T2) to be timed; // Get the end count value R1: = (T2-T1) / C1; // get the timing time, unit Second (S) R1: = (T2-T1) / C1 * 1000; // Net time, unit milliseconds (MS) R1: = (T2-T1) / C1 * 1000000; // get the timing time, unit microsecond ShowMessage (FLOATTOSTR (R1));