X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsupport%2FTimeout.h;h=042ed4587be0cb439ab8d958f2002f0b538a7354;hb=aef8746712ccc64f1f10073fe6d011ff1d7eb4a4;hp=28b00333be1e09c09000cc2f3d668ed1674afa70;hpb=adaad6e2e53630263c64b42f75c170a463a106a1;p=lyx.git diff --git a/src/support/Timeout.h b/src/support/Timeout.h index 28b00333be..042ed4587b 100644 --- a/src/support/Timeout.h +++ b/src/support/Timeout.h @@ -12,7 +12,7 @@ #ifndef TIMEOUT_H #define TIMEOUT_H -#include +#include namespace lyx { @@ -40,7 +40,7 @@ public: /// restart the timer void restart(); /// signal emitted on timer expiry - boost::signal timeout; + boost::signals2::signal timeout; /// emit the signal void emit(); /// set the timer type @@ -64,6 +64,30 @@ private: unsigned int timeout_ms; }; +// Small Timer class useful for debugging and performance investigation. +class Timer +{ +public: + /// + Timer(); + /// + ~Timer(); + /// + void restart(); + /// + int elapsed() const; + /// + std::string dateStr(char separator = 0) const; + /// + std::string timeStr(char separator = 0) const; + /// + std::string toStr() const; + /// + static std::string currentToStr(); +private: + struct Private; + Private * d; +}; } // namespace lyx