ex70.pp 528 B

12345678910111213141516171819202122232425262728
  1. Program Example70;
  2. { This program demonstrates the MilliSecondSpan function }
  3. Uses SysUtils,DateUtils;
  4. Procedure Test(ANow,AThen : TDateTime);
  5. begin
  6. Write('Number of milliseconds between ');
  7. Write(TimeToStr(AThen),' and ',TimeToStr(ANow));
  8. Writeln(' : ',MilliSecondSpan(ANow,AThen));
  9. end;
  10. Var
  11. D1,D2 : TDateTime;
  12. Begin
  13. D1:=Now;
  14. D2:=D1-(0.9*OneMilliSecond);
  15. Test(D1,D2);
  16. D2:=D1-(1.0*OneMilliSecond);
  17. Test(D1,D2);
  18. D2:=D1-(1.1*OneMilliSecond);
  19. Test(D1,D2);
  20. D2:=D1-(2.5*OneMilliSecond);
  21. Test(D1,D2);
  22. End.