X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/2f03297fba2a10dbc860018fac7ad07c83b08ce8..0ac6b47e810e6efaebcdbf3075b633e9b4109341:/ltimevalstuff.inc?ds=inline diff --git a/ltimevalstuff.inc b/ltimevalstuff.inc deleted file mode 100755 index 0ac92cb..0000000 --- a/ltimevalstuff.inc +++ /dev/null @@ -1,42 +0,0 @@ -{ Copyright (C) 2005 Bas Steendijk and Peter Green - For conditions of distribution and use, see copyright notice in zlib_license.txt - which is included in the package - ----------------------------------------------------------------------------- } - - - -{add nn msec to tv} -const - tv_invalidtimebig : ttimeval = (tv_sec:maxlongint;tv_usec:maxlongint); - //tv_invalidtimebig will always compare as greater than any valid timeval -procedure tv_add(var tv:ttimeval;msec:integer);//{ $ifdef fpc}inline;{ $endif} -begin - inc(tv.tv_usec,msec*1000); - inc(tv.tv_sec,tv.tv_usec div 1000000); - tv.tv_usec := tv.tv_usec mod 1000000; -end; - -{tv1 >= tv2} -function tv_compare(const tv1,tv2:ttimeval):boolean;//{ $ifdef fpc}inline;{ $endif} -begin - if tv1.tv_sec = tv2.tv_sec then begin - result := tv1.tv_usec >= tv2.tv_usec; - end else result := tv1.tv_sec > tv2.tv_sec; -end; - -procedure tv_substract(var tv:ttimeval;const tv2:ttimeval);//{ $ifdef fpc}inline;{ $endif} -begin - dec(tv.tv_usec,tv2.tv_usec); - if tv.tv_usec < 0 then begin - inc(tv.tv_usec,1000000); - dec(tv.tv_sec) - end; - dec(tv.tv_sec,tv2.tv_sec); -end; - -procedure msectotimeval(var tv:ttimeval;msec:integer); -begin - tv.tv_sec := msec div 1000; - tv.tv_usec := (msec mod 1000)*1000; -end; -