As far as I know the lowest possible value for TTimer.Interval is 15 on Windows 7, any lower value will be ignored.
Typically, the minimum interval is about
10ms on all Windows systems (at least since Windows XP). The minimum available interval is
1ms, but to activate it, use the
timeBeginPeriod function, and when high resolution is no longer needed, restore the previous one using the
timeEndPeriod function. Two simple functions are enough for this:
uses
MMSystem;
var
TimePeriod: Integer = -1;
procedure InitializeShedulerResolution();
var
Periods: TTimeCaps;
begin
if TimeGetDevCaps(@Periods, SizeOf(Periods)) = TIMERR_NOERROR then
if TimeBeginPeriod(Periods.wPeriodMin) = TIMERR_NOERROR then
TimePeriod := Periods.wPeriodMin;
end;
procedure FinalizeShedulerResolution();
begin
if TimePeriod <> -1 then
TimeEndPeriod(TimePeriod);
end;
This is an example of setting a minimum interval, once for the entire program session.
Within one session of the program, the resolution of the sheduler can be changed many times, but there must be the same number of calls to
timeBeginPeriod as to
timeEndPeriod. You can change the resolution only when you need it and then restore it right away. This will allow you to use slightly less energy and increase system performance, because the sheduler will run at a higher resolution only at specific times, not for the entire session of the program. Although in the end, the system will decide it anyway, but it would be good to help it with this.
When creating games, you don't have to worry about it, because libraries such as SDL take care of it for us.