qwt_system_clock.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
  2. * Qwt Widget Library
  3. * Copyright (C) 1997 Josef Wilgen
  4. * Copyright (C) 2002 Uwe Rathmann
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the Qwt License, Version 1.0
  8. *****************************************************************************/
  9. #ifndef QWT_SYSTEM_CLOCK_H
  10. #define QWT_SYSTEM_CLOCK_H
  11. #include "qwt_global.h"
  12. /*!
  13. \brief QwtSystemClock provides high resolution clock time functions.
  14. Sometimes the resolution offered by QTime ( millisecond ) is not accurate
  15. enough for implementing time measurements ( f.e. sampling ).
  16. QwtSystemClock offers a subset of the QTime functionality using higher
  17. resolution timers ( if possible ).
  18. Precision and time intervals are multiples of milliseconds (ms).
  19. ( QwtSystemClock is obsolete since Qt 4.8 as QElapsedTimer offers the same
  20. precision )
  21. \note The implementation uses high-resolution performance counter on Windows,
  22. mach_absolute_time() on the Mac or POSIX timers on other systems.
  23. If none is available it falls back on QTimer.
  24. */
  25. class QWT_EXPORT QwtSystemClock
  26. {
  27. public:
  28. QwtSystemClock();
  29. virtual ~QwtSystemClock();
  30. bool isNull() const;
  31. void start();
  32. double restart();
  33. double elapsed() const;
  34. private:
  35. class PrivateData;
  36. PrivateData *d_data;
  37. };
  38. #endif