]> git.lyx.org Git - lyx.git/blobdiff - src/support/Timeout.h
More requires --> required, for C++2a.
[lyx.git] / src / support / Timeout.h
index 28b00333be1e09c09000cc2f3d668ed1674afa70..eef78dbec6330ec0bd154626d917a9fee652363b 100644 (file)
@@ -12,7 +12,7 @@
 #ifndef TIMEOUT_H
 #define TIMEOUT_H
 
-#include <boost/signal.hpp>
+#include "support/signals.h"
 
 
 namespace lyx {
@@ -40,7 +40,7 @@ public:
        /// restart the timer
        void restart();
        /// signal emitted on timer expiry
-       boost::signal<void()> timeout;
+       signals2::signal<void()> 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