timerd.inc 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. {
  2. Free Pascal port of the OpenPTC C++ library.
  3. Copyright (C) 2001-2003 Nikolay Nikolov ([email protected])
  4. Original C++ version by Glenn Fiedler ([email protected])
  5. This library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Lesser General Public
  7. License as published by the Free Software Foundation; either
  8. version 2.1 of the License, or (at your option) any later version.
  9. This library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public
  14. License along with this library; if not, write to the Free Software
  15. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. }
  17. Type
  18. TPTCTimer=Class(TObject)
  19. Private
  20. m_old : Double;
  21. m_time : Double;
  22. m_start : Double;
  23. m_current : Double;
  24. m_running : Boolean;
  25. {$IFDEF WIN32}
  26. m_frequency : QWord;
  27. {$ENDIF WIN32}
  28. Function clock : Double;
  29. Procedure internal_init_timer;
  30. Public
  31. Constructor Create;
  32. Constructor Create(_time : Double);
  33. Constructor Create(Const timer : TPTCTimer);
  34. Destructor Destroy; Override;
  35. Procedure Assign(Const timer : TPTCTimer);
  36. Function Equals(Const timer : TPTCTimer) : Boolean;
  37. Procedure settime(_time : Double); {was 'set' in the C++ version}
  38. Procedure start;
  39. Procedure stop;
  40. Function time : Double;
  41. Function delta : Double;
  42. Function resolution : Double;
  43. End;