[Lazarus] Epiktimer elapsed = negative value

Anthony Tekatch anthony at unihedron.com
Sun Jul 6 17:39:28 CEST 2014


Occasionally I get a negative "Elapsed" value using EpikTimer. Here is my code:

    RunWhile:=True;
    DelayInSeconds := 1.00; //Store every x seconds
    while RunWhile do begin
      ET.Clear;
      ET.Start;
      while (ET.Elapsed  < DelayInSeconds) and RunWhile do begin
        ET.SystemSleep(10);
        writeln('ET.Elapsed=',ET.Elapsed);
        if (ET.Elapsed < 0 ) then RunWhile:=False;
      end;
      LogOneReading(); //Store successive readings (my code)
    end;

This is the output after about 5 to 20 minutes where you can see the last
line showing the negative value:
...
ET.Elapsed= 4.4526500000000000E-0001
ET.Elapsed= 4.5535900000000000E-0001
ET.Elapsed= 4.6544100000000000E-0001
ET.Elapsed=-4.2944917280000000E+0003


I did install EpikTimer from the latest github.

I am using Linux, and had to add "linux" to the uses clause to prevent
the clock_gettime() error.


Thanks for looking,
Anthony


More information about the Lazarus mailing list