X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/555c3c210bd8d681d3b485023926e55b8866eb79..fb5326037eba3c03fc24b645811e2e460365e8b9:/btime.pas?ds=inline diff --git a/btime.pas b/btime.pas index 62b957d..c130144 100644 --- a/btime.pas +++ b/btime.pas @@ -226,7 +226,7 @@ var f,g:float; o:tosversioninfo; isnt:boolean; - is9x:boolean; +{ is9x:boolean;} begin if (performancecountfreq = 0) then qpctimefloat; ticks_freq_known := false; @@ -239,7 +239,7 @@ begin o.dwOSVersionInfoSize := sizeof(o); getversionex(o); isnt := o.dwPlatformId = VER_PLATFORM_WIN32_NT; - is9x := o.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS; +{ is9x := o.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS;} ticks_freq2 := f; mmtime_synchedqpc := false; @@ -327,14 +327,14 @@ const maxretries=5; margin=0.002; var - jump:float; - mm,f,qpc,newdrift,f1,f2:float; +{ jump:float;} + mm,f,qpc,newdrift:float; qpcjumped:boolean; - a,b,c:integer; - retrycount:integer; + a,b:integer; +{ retrycount:integer;} begin if not ticks_freq_known then measure_ticks_freq; - retrycount := maxretries; +{ retrycount := maxretries;} qpc := qpctimefloat; mm := mmtimefloat; @@ -351,7 +351,7 @@ begin mmtime_prev_lastsyncqpc := mmtime_lastsyncqpc; mm := mmtimefloat; - dec(retrycount); + { dec(retrycount);} settc; result := qpctimefloat; f := mmtimefloat; @@ -382,6 +382,7 @@ begin { mmtime_drift := mmtime_drift + mmtime_driftavg[a];} end; { mmtime_drift := mmtime_drift / b;} + a := 5; if (b = 1) then a := 5 else if (b = 2) then a := 15 else if (b = 3) then a := 30 else if (b = 4) then a := 60 else if (b = 5) then a := 120 else if (b >= 5) then a := 120; mmtime_nextdriftcorrection := qpc + a; if (b >= 2) then warmup_finished := true; @@ -399,10 +400,10 @@ begin qpc := qpctimefloat; result := (qpc - mmtime_lastsyncqpc) * mmtime_drift + mmtime_lastsyncmm; - f := (qpc - mmtime_prev_lastsyncqpc) * mmtime_prev_drift + mmtime_prev_lastsyncmm; + {f := (qpc - mmtime_prev_lastsyncqpc) * mmtime_prev_drift + mmtime_prev_lastsyncmm; jump := result-f; - {writeln('jump ',formatfloat('0.000000',jump),' drift ',formatfloat('0.00000000',mmtime_drift),' duration ',formatfloat('0.000',(mmtime_lastsyncqpc-mmtime_prev_lastsyncqpc)),' ',formatfloat('0.00000000',jump/(mmtime_lastsyncqpc-mmtime_prev_lastsyncqpc)));} + writeln('jump ',formatfloat('0.000000',jump),' drift ',formatfloat('0.00000000',mmtime_drift),' duration ',formatfloat('0.000',(mmtime_lastsyncqpc-mmtime_prev_lastsyncqpc)),' ',formatfloat('0.00000000',jump/(mmtime_lastsyncqpc-mmtime_prev_lastsyncqpc)));} f := result; end;