Try using timeGetTime for more accurate results than GetTickCount. Use it like this:

initialisation (done once at program start-up):

[pascal]var
TimeCaps: TTimeCaps;

FillChar(TimeCaps, SizeOf(TimeCaps), 0);
timeGetDevCaps(@TimeCaps, SizeOf(TimeCaps));
timeBeginPeriod(TimeCaps.wPeriodMin);[/pascal]

at the end (done once at program finish):
[pascal]timeEndPeriod(TimeCaps.wPeriodMin);[/pascal]

Then you can use timeGetTime in exactly the same way as GetTickCount (literally just replacing the two). Remember to add MMSystem to your uses clause. Alternatively, you can use QueryPerformanceFrequency/QueryPerformanceCounter instead.

As an aside, should you not be using unsigned values (Cardinal or Longword instead of Integer) when dealing with GetTickCount? I seem to recall that it gives back a dword. This change may be handy if you get signed/unsigned warnings.

Anyway, it looks quite handy (except for the fact that I've done sod all programming recently so I won't be using it soon ).